Uploaded image for project: 'JBoss Developer Materials'
  1. JBoss Developer Materials
  2. JDF-333

Retrieval of images breaks when the underlying cache store is deleted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jdfsite-2.1.3.Final
    • None
    • None
    • None

      The following error was reported by the deployment of TicketMonster on OpenShift:

      2013/05/26 05:53:53,279 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[org.jboss.jdf.example.ticketmonster.rest.JaxRsActivator]] (http-/127.4.240.129:8080-10) JBWEB000236: Servlet.service() for servlet org.jboss.jdf.example.ticketmonster.rest.JaxRsActivator threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalStateException: Error creating cached file
      	at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:365) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec.jar:1.0.2.Final-redhat-1]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa.jar:7.2.0.Final-redhat-8]
      	at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa.jar:7.2.0.Final-redhat-8]
      	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web.jar:7.2.0.Final-redhat-8]
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb.jar:7.2.0.Final-redhat-1]
      	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_19]
      Caused by: java.lang.IllegalStateException: Error creating cached file
      	at org.jboss.jdf.example.ticketmonster.service.MediaManager.getCachedOutputStream(MediaManager.java:209) [classes:]
      	at org.jboss.jdf.example.ticketmonster.service.MediaManager.createCachedMedia(MediaManager.java:181) [classes:]
      	at org.jboss.jdf.example.ticketmonster.service.MediaManager.createCachedMedia(MediaManager.java:202) [classes:]
      	at org.jboss.jdf.example.ticketmonster.service.MediaManager.createPath(MediaManager.java:112) [classes:]
      	at org.jboss.jdf.example.ticketmonster.service.MediaManager.getPath(MediaManager.java:93) [classes:]
      	at org.jboss.jdf.example.ticketmonster.service.MediaManager$Proxy$_$$_WeldClientProxy.getPath(MediaManager$Proxy$_$$_WeldClientProxy.java) [classes:]
      	at org.jboss.jdf.example.ticketmonster.rest.MediaService.getMediaContent(MediaService.java:40) [classes:]
      	at org.jboss.jdf.example.ticketmonster.rest.MediaService$Proxy$_$$_WeldClientProxy.getMediaContent(MediaService$Proxy$_$$_WeldClientProxy.java) [classes:]
      	at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) [:1.7.0_19]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_19]
      	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_19]
      	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
      	... 21 more
      Caused by: java.io.FileNotFoundException: /tmp/org.jboss.jdf.examples.ticket-monster/aHR0cDovL2RsLmRyb3Bib3guY29tL3UvNjU2NjA2ODQvNjQwcHgtV2VpciUyQ19Cb2JfKDIwMDcpXzIuanBn (No such file or directory)
      	at java.io.FileOutputStream.open(Native Method) [rt.jar:1.7.0_19]
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:212) [rt.jar:1.7.0_19]
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:165) [rt.jar:1.7.0_19]
      	at org.jboss.jdf.example.ticketmonster.service.MediaManager.getCachedOutputStream(MediaManager.java:207) [classes:]
      	... 36 more
      

      OpenShift tends to delete files under /tmp that are untouched for 10 days or more. The TicketMonster MediaManager should therefore use a more persistent store (like OPENSHIFT_DATA_DIR) or re-create the files in the cache (less preferable, since the hosted files may go down).

              vineet.reynolds_jira Vineet Reynolds (Inactive)
              vineet.reynolds_jira Vineet Reynolds (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: