简体   繁体   中英

File upload rest service using Mule Error

I have created a File upload rest service using Mule and jersey according to this post . Everything is working fine, but the problem with this is that somehow mule is not releasing the lock on the file which is getting uploaded on server side. So you can not move or delete the file while mule server is running. How can I remove this restriction ?

From what you're saying in the comments and looking at the source code of the blog post you mention, I reckon the problem lies here:

finally{
  if(out !=null)
    try {
     uploadedInputStream.close();
     out.close();
    } catch (IOException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    }

My impression is that uploadedInputStream.close() fails and out.close() never gets released. Closing uploadedInputStream is useless here so I suggest you remove the line and see if the lock gets removed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM