Topic
  • No replies
SystemAdmin
SystemAdmin
895 Posts

Pinned topic The process cannot access the file because it is being used by another user

‏2008-03-11T03:21:09Z |
Hi,

I have this error from an Image Button that links to a Static Content URL to display a PDF file in a Portlet Factory application: The process cannot access the file because it is being used by another process, the details shown below:

An error has occurred.
The error message returned was: C:\ibm\WebSphere\profiles\wp_profile\installedApps\hsvmw\Extranet.ear\wpf.war\documents\MvxExtracts\Invoice\8FC57D3721ECAA8C866889C688D3D1\Invoice.PDF (The process cannot access the file because it is being used by another process).

Please refer to the logs folder in your deployed application for additional error information.

Click here for a detailed error message. Click here to hide the detailed error message.
Exception java.io.FileNotFoundException: C:\ibm\WebSphere\profiles\wp_profile\installedApps\hsvmw\Extranet.ear\wpf.war\documents\MvxExtracts\Invoice\8FC57D3721ECAA8C866889C688D3D1\Invoice.PDF (The process cannot access the file because it is being used by another process)
Stack Trace
java.io.FileNotFoundException: C:\ibm\WebSphere\profiles\wp_profile\installedApps\hsvmw\Extranet.ear\wpf.war\documents\MvxExtracts\Invoice\8FC57D3721ECAA8C866889C688D3D1\Invoice.PDF (The process cannot access the file because it is being used by another process)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StaticFileServletWrapper.getInputStream(StaticFileServletWrapper.java:38)
at com.ibm.ws.webcontainer.servlet.FileServletWrapper.service(FileServletWrapper.java:585)
at com.ibm.ws.webcontainer.servlet.FileServletWrapper.service(FileServletWrapper.java:764)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
at com.ibm.ws.webcontainer.servlet.FileServletWrapper.handleRequest(FileServletWrapper.java:363)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:676)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3071)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:236)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1958)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:98)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

However, when I go back and click the button again, it works. It doesn't work only on the first time you click the button.

This problem wasn't there before we shifted WAS security from the default SQL server driven WebSphere Security to one that Oracle Access Manager driven. I don't know if this has a bearing or whether this is just coincidental.

I've checked on the resource URLs that have been defined as protected in the security policy but definitely, the URL to the PDF file is not protected.

I've also tried inserting a "thread.sleep" to delay the PDF file opening process to give the back-end program time to finish the extraction and the FTP of the file to the proper subdirectory. However, please note that from previous test sessions that worked, we know that this process shouldn't take more than a couple of seconds.

Please help me resolve this problem. How does one pool for the existence of the file in the directory?

smather