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

Impossible to download a zip file in a nested document

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      If I try to upload a .docx file as attachment The file get corrupted and the following error message appears in catalina.out

      This only happens if I try upload in a nested Dashboard. Here are the steps to reproduce the error:

      1. create a new dashboard (title: TestDashboard) and save
      2. create a blank page from within the newly created dashboard (tile: TestPage) and save
      3. click attachments: select the test.docx file from this bug report
      4. download the attachment and save it as "test download.docx"

      This error happens as well with a .odt file. Other file types like .doc and .pdf are working fine.

      The files test.* have all the same content but a different format. The files"test download.*" are the downloaded files from my installation. The .docx and .odt version are corrupt.

      Additional the catalina.out from my test installation as well.

      2015-10-07 15:26:02,380 [http://192.168.89.163:8080/xwiki/bin/download/Test+Dashboard/Test+Page/WebHome/test.docx] 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:444) [XWikiAction.class:na]
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:184) [XWikiAction.class:na]
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) [RequestProcessor.class:1.3.10]
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) [RequestProcessor.class:1.3.10]
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) [ActionServlet.class:1.3.10]
      	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) [ActionServlet.class:1.3.10]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:618) [tomcat8-servlet-api-8.0.14.jar:na]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [tomcat8-servlet-api-8.0.14.jar:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115) [ActionFilter.class:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127) [ConversionFilter.class:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat8-websocket-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63) [SetHTTPHeaderFilter.class:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66) [XWikiDavFilter.class:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) [SavedRequestRestorerFilter.class:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111) [SetCharacterEncodingFilter.class:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:137) [RoutingFilter.class:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) [tomcat8-catalina-8.0.14.jar:8.0.14]
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081) [tomcat8-coyote-8.0.14.jar:8.0.14]
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) [tomcat8-coyote-8.0.14.jar:8.0.14]
      	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) [tomcat8-coyote-8.0.14.jar:8.0.14]
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566) [tomcat8-coyote-8.0.14.jar:8.0.14]
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523) [tomcat8-coyote-8.0.14.jar:8.0.14]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79]
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat8-util-8.0.14.jar:8.0.14]
      	at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
      Caused by: java.lang.IllegalArgumentException: An Entity Reference name cannot be null or empty
      	at org.xwiki.model.reference.EntityReference.setName(EntityReference.java:185) ~[EntityReference.class:na]
      	at org.xwiki.model.reference.EntityReference.<init>(EntityReference.java:153) ~[EntityReference.class:na]
      	at org.xwiki.model.reference.AttachmentReference.<init>(AttachmentReference.java:68) ~[AttachmentReference.class:na]
      	at com.xpn.xwiki.doc.XWikiAttachment.getReference(XWikiAttachment.java:156) ~[XWikiAttachment.class:na]
      	at com.xpn.xwiki.doc.XWikiAttachment.extractMimeType(XWikiAttachment.java:980) ~[XWikiAttachment.class:na]
      	at com.xpn.xwiki.doc.XWikiAttachment.getMimeType(XWikiAttachment.java:923) ~[XWikiAttachment.class:na]
      	at com.xpn.xwiki.web.DownloadAction.setCommonHeaders(DownloadAction.java:427) ~[DownloadAction.class:na]
      	at com.xpn.xwiki.web.DownloadAction.sendContent(DownloadAction.java:291) ~[DownloadAction.class:na]
      	at com.xpn.xwiki.web.DownloadAction.render(DownloadAction.java:174) ~[DownloadAction.class:na]
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:417) [XWikiAction.class:na]
      	... 50 common frames omitted
      

      Attachments

        1. test download.pdf
          6 kB
        2. test download.odt
          22 kB
        3. test download.docx
          22 kB
        4. test download.doc
          18 kB
        5. test.pdf
          6 kB
        6. test.odt
          15 kB
        7. test.docx
          5 kB
        8. test.doc
          18 kB
        9. catalina.out
          51 kB

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              zzeroo zzeroo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h