Wicket
  1. Wicket
  2. WICKET-4176

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.5.3
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows 7
      JVM: Java HotSpot(TM) 64-Bit Server VM (19.1-b02, mixed mode)
      Java: version 1.6.0_24, vendor Sun Microsystems Inc.
      wicket runnniung on tomcat : 6.0.33

      Description

      java.io.FileNotFoundException: C:\dev\apache-tomcat-6.0.33\work\Catalina\localhost\directski\directSkiApplication-filestore\52151B2227FD9F98206208E39B6831D7\data (The process cannot access the file be
      cause it is being used by another process)
      at java.io.RandomAccessFile.open(Native Method)
      at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
      at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:401)
      at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:328)
      at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:176)
      at org.apache.wicket.pageStore.AsynchronousDataStore.storeData(AsynchronousDataStore.java:227)
      at org.apache.wicket.pageStore.DefaultPageStore.storePageData(DefaultPageStore.java:119)
      at org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:150)
      at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383)
      at org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171)
      at org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:94)
      at org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
      at org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:256)
      at org.apache.wicket.Application$2.onDetach(Application.java:1587)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:99)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:97)
      at org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:119)
      at org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:142)
      at org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:95)
      at org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:569)
      at org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:508)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:284)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
      at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:369)
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168)
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
      at java.lang.Thread.run(Thread.java:662)
      2011-10-26 12:08:33,126 [http-8080-66] ERROR org.apache.wicket.util.listener.ListenerCollection - Error invoking listener: org.apache.wicket.Application$2@28655b7e
      java.lang.NullPointerException
      at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:332)
      at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:176)
      at org.apache.wicket.pageStore.AsynchronousDataStore.storeData(AsynchronousDataStore.java:227)
      at org.apache.wicket.pageStore.DefaultPageStore.storePageData(DefaultPageStore.java:119)
      at org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:150)
      at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383)
      at org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171)
      at org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:94)
      at org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
      at org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:256)
      at org.apache.wicket.Application$2.onDetach(Application.java:1587)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:99)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:97)
      at org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:119)
      at org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:142)
      at org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:95)
      at org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:569)
      at org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:508)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:284)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
      at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:369)
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
      at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168)
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
      at java.lang.Thread.run(Thread.java:662)

      This bug happens on heavy loaded system , i was using jMeter to load it

        Activity

        Hide
        MK added a comment -

        Yes i think you are right i have used Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645) and it seems that other process is a) windows indexing or b) antivirus thanks

        Show
        MK added a comment - Yes i think you are right i have used Process Monitor ( http://technet.microsoft.com/en-us/sysinternals/bb896645 ) and it seems that other process is a) windows indexing or b) antivirus thanks
        Hide
        Martin Grigorov added a comment -

        It is still one process, but two threads.
        I'm 99% certain it is Windows to blame. Check with ProcessExplorer (http://technet.microsoft.com/en-us/sysinternals/bb896653) which process(es) keep a handle to this file.

        Show
        Martin Grigorov added a comment - It is still one process, but two threads. I'm 99% certain it is Windows to blame. Check with ProcessExplorer ( http://technet.microsoft.com/en-us/sysinternals/bb896653 ) which process(es) keep a handle to this file.
        Hide
        MK added a comment -

        I think the problem is when the entries queue is full AsynchronousDataStore is trying to write to file itself so when PageSavingRunnable will have the same session on the queue as AsynchronousDataStore than two processes will write to the same file .

        Show
        MK added a comment - I think the problem is when the entries queue is full AsynchronousDataStore is trying to write to file itself so when PageSavingRunnable will have the same session on the queue as AsynchronousDataStore than two processes will write to the same file .
        Hide
        Martin Grigorov added a comment -

        Improved the error handling with r1189175.

        Now if the file is existing but cannot be opened for some reason Wicket will just log the problems and continue without saving the page's bytes.

        In your case it seems Windows Explorer or any editor has locked the file.

        Show
        Martin Grigorov added a comment - Improved the error handling with r1189175. Now if the file is existing but cannot be opened for some reason Wicket will just log the problems and continue without saving the page's bytes. In your case it seems Windows Explorer or any editor has locked the file.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            MK
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development