Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-16038

Adding a Upload Preprocessor in 16.1.0 will break any file upload

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 16.1.0
    • 16.1.1, 16.2.0
    • archetype
    • None
    • windows and linux
    • Orion
    • Orion.Cycle8.Sprint
    • Undetermined
    • Small (1-2)

    Description

      When you add an Upload PreProcessor (even without any implementation code) in 16.1.0 you can no longer upload any asset or image.

      Steps to reproduce the problem:

      1. Create project from 16.1.0 archetype
      2. Build and run it
      3. Upload an image or an asset and see it succeeds
      4. Add an Upload PreProcessor as described at https://xmdocumentation.bloomreach.com/library/concepts/images-and-assets/implement-a-custom-file-upload-preprocessor.html (implementation of the process() method can be empty)
      5. Build and run it
      6. Upload an image or an asset and see it fails with below stack trace
      [INFO] 13.11.2024 09:18:59 ERROR http-nio-8080-exec-5 [AjaxFileUploadBehavior.onRequest:117] There was a problem processing the file VFG7004705706.pdf, the file couldn't be uploaded
      [INFO] java.nio.file.NoSuchFileException: C:\temp\myproject\target\tomcat10x\temp\3C7A8EB6B13DF11A7A0D8F37B63C1561_173148593948117098789133879103982files[]
      [INFO]  at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[?:?]
      [INFO]  at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
      [INFO]  at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
      [INFO]  at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236) ~[?:?]
      [INFO]  at java.base/java.nio.file.Files.newByteChannel(Files.java:380) ~[?:?]
      [INFO]  at java.base/java.nio.file.Files.newByteChannel(Files.java:432) ~[?:?]
      [INFO]  at java.base/java.nio.file.Files.readAllBytes(Files.java:3288) ~[?:?]
      [INFO]  at org.hippoecm.frontend.plugins.yui.upload.processor.DefaultFileUploadPreProcessorService.getFileUpload(DefaultFileUploadPreProcessorService.java:118) ~[hippo-cms-api-16.1.0.jar:16.1.0]
      [INFO]  at org.hippoecm.frontend.plugins.yui.upload.processor.DefaultFileUploadPreProcessorService.process(DefaultFileUploadPreProcessorService.java:81) ~[hippo-cms-api-16.1.0.jar:16.1.0]
      [INFO]  at org.hippoecm.frontend.plugins.jquery.upload.AbstractFileUploadWidget.preProcess(AbstractFileUploadWidget.java:103) ~[hippo-cms-api-16.1.0.jar:16.1.0]
      [INFO]  at org.hippoecm.frontend.plugins.jquery.upload.multiple.FileUploadWidget.access$400(FileUploadWidget.java:48) ~[hippo-cms-api-16.1.0.jar:16.1.0]
      [INFO]  at org.hippoecm.frontend.plugins.jquery.upload.multiple.FileUploadWidget$1.preProcess(FileUploadWidget.java:114) ~[hippo-cms-api-16.1.0.jar:16.1.0]
      [INFO]  at org.hippoecm.frontend.plugins.jquery.upload.behaviors.AjaxFileUploadBehavior.onRequest(AjaxFileUploadBehavior.java:106) [hippo-cms-api-16.1.0.jar:16.1.0]
      [INFO]  at org.apache.wicket.core.request.handler.ListenerRequestHandler.internalInvoke(ListenerRequestHandler.java:300) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.core.request.handler.ListenerRequestHandler.invoke(ListenerRequestHandler.java:274) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.core.request.handler.ListenerRequestHandler.invokeListener(ListenerRequestHandler.java:222) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.core.request.handler.ListenerRequestHandler.respond(ListenerRequestHandler.java:202) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:910) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:63) [wicket-request-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:294) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:255) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:277) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:208) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:307) [wicket-core-10.1.0.jar:10.1.0]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.25]
      [INFO]  at org.hippoecm.hst.core.container.FilterChainInvokingValve.invoke(FilterChainInvokingValve.java:74) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.JCRSessionStatefulConcurrencyValve.invoke(JCRSessionStatefulConcurrencyValve.java:56) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.SubjectBasedSessionValve.invoke(SubjectBasedSessionValve.java:58) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.SecurityValve.invoke(SecurityValve.java:177) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.LocalizationValve.invoke(LocalizationValve.java:101) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.RequestTypeContextValve.invoke(RequestTypeContextValve.java:53) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.CmsSecurityValve.invoke(CmsSecurityValve.java:77) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.InitializationValve.invoke(InitializationValve.java:40) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:288) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline.invokeValves(HstSitePipeline.java:173) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstSitePipeline.invoke(HstSitePipeline.java:155) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.core.container.HstRequestProcessorImpl.processRequest(HstRequestProcessorImpl.java:82) [hst-core-16.1.0.jar:?]
      [INFO]  at org.hippoecm.hst.container.HstDelegateeFilterBean.doFilter(HstDelegateeFilterBean.java:720) [hst-core-16.1.0.jar:16.1.0]
      [INFO]  at org.hippoecm.hst.container.DelegatingFilter.doFilter(DelegatingFilter.java:68) [hst-commons-16.1.0.jar:16.1.0]
      [INFO]  at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:51) [hst-commons-16.1.0.jar:16.1.0]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.25]
      [INFO]  at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-6.1.13.jar:6.1.13]
      [INFO]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) [spring-web-6.1.13.jar:6.1.13]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.25]
      [INFO]  at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-6.1.13.jar:6.1.13]
      [INFO]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) [spring-web-6.1.13.jar:6.1.13]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.25]
      [INFO]  at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:124) [spring-boot-3.3.4.jar:3.3.4]
      [INFO]  at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:99) [spring-boot-3.3.4.jar:3.3.4]
      [INFO]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) [spring-web-6.1.13.jar:6.1.13]
      [INFO]  at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:117) [spring-boot-3.3.4.jar:3.3.4]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.25]
      [INFO]  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-6.1.13.jar:6.1.13]
      [INFO]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) [spring-web-6.1.13.jar:6.1.13]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:663) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:10.1.25]
      [INFO]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [catalina.jar:10.1.25]
      [INFO]  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389) [tomcat-coyote.jar:10.1.25]
      [INFO]  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) [tomcat-coyote.jar:10.1.25]
      [INFO]  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:904) [tomcat-coyote.jar:10.1.25]
      [INFO]  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) [tomcat-coyote.jar:10.1.25]
      [INFO]  at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) [tomcat-coyote.jar:10.1.25]
      [INFO]  at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) [tomcat-util.jar:10.1.25]
      [INFO]  at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-util.jar:10.1.25]
      [INFO]  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) [tomcat-util.jar:10.1.25]
      [INFO]  at java.base/java.lang.Thread.run(Thread.java:833) [?:?]
      

      I tried this also with an 15.6.0 archetype and there it works fine.

      The error is somewehere in the getFileUpload() method of the 
      DefaultFileUploadPreProcessorService class and the name of the temporary file that is created there and cannot be deleted in the finally clause.
       
      Since we rely on Upload Preprocessors in our project and are no longer able to upload files now we expect this should be solved on very short notice.

      Attachments

        Issue Links

          Activity

            People

              jhoffman Jeroen Hoffman
              robharing Rob Haring
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: