Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21614

Attachment redirect fails in case of null XObject

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      Attachment redirection fails in case of null XObject

      2023-11-20 14:14:15,773 [http-nio-8080-exec-42 - http://********************* WARN c.x.x.w.XWikiAction - Uncaught exception: Error number 0 in 11: Uncaught exception
      com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:662)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:339)
      at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
      at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
      at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.base/java.lang.Thread.run(Thread.java:832)
      Caused by: java.lang.NullPointerException: null
      at org.xwiki.attachment.internal.DefaultAttachmentsManager.lambda$getRedirection$0(DefaultAttachmentsManager.java:83)
      at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
      at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812)
      at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
      at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
      at org.xwiki.attachment.internal.DefaultAttachmentsManager.getRedirection(DefaultAttachmentsManager.java:85)
      at org.xwiki.attachment.internal.AttachmentsRedirectionFilter.redirect(AttachmentsRedirectionFilter.java:67)
      at com.xpn.xwiki.web.XWikiAction.handleRedirect(XWikiAction.java:1287)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:629)
      … 43 common frames omitted
      

      Root cause: https://github.com/xwiki/xwiki-platform/blob/03d67d2a96af8d986d7bdec3a70d4e53255d66d1/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/src/main/java/org/xwiki/attachment/internal/DefaultAttachmentsManager.java#L82
      Other potential issue to fix

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            mleduc Manuel Leduc
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: