Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-19835

Fix BlobsWriter with empty multipart content

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.10-HF11, 8.2
    • Fix Version/s: 8.10
    • Component/s: Automation
    • Backlog priority:
      300
    • Sprint:
      nxfit 8.3.7, nxfit 8.4.2, nxfit 8.4.1, nxfit 8.4.3
    • Story Points:
      3

      Description

      When using with clients (automation and the new one) the operation Document.GetBlobsByProperty (org.nuxeo.ecm.automation.core.operations.blob.GetDocumentBlobs, exception is thrown when bloblist is empty in org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter:

      15:27:19,170 WARN  [Log4JLogger] /api/v1/automation/Document.GetBlobsByProperty
      java.io.IOException: Failed to return blobs
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter.writeTo(BlobsWriter.java:52)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter.writeTo(BlobsWriter.java:39)
      	at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
      	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
      	at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.containerService(WebEngineServlet.java:178)
      	at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.service(WebEngineServlet.java:155)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
      	at org.nuxeo.ecm.webengine.jaxrs.context.RequestContextFilter.run(RequestContextFilter.java:48)
      	at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
      	at org.nuxeo.ecm.webengine.jaxrs.session.SessionCleanupFilter.run(SessionCleanupFilter.java:50)
      	at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
      	at org.nuxeo.ecm.webengine.app.WebEngineFilter.doFilter(WebEngineFilter.java:94)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
      	at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilterInternal(NuxeoAuthenticationFilter.java:592)
      	at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilter(NuxeoAuthenticationFilter.java:399)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:322)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
      Caused by: javax.mail.MessagingException: Empty multipart: multipart/mixed; 
      	boundary="----=_Part_0_181743416.1466018839154"
      	at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:457)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter.writeTo(BlobsWriter.java:49)
      	... 39 more
      ​
      Exception:
        status: 500
        info: <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
      <title>Error 500 Failed to return blobs</title>
      </head>
      <body><h2>HTTP ERROR 500</h2>
      <p>Problem accessing /api/v1/automation/Document.GetBlobsByProperty. Reason:
      <pre>    Failed to return blobs</pre></p><h3>Caused by:</h3><pre>java.io.IOException: Failed to return blobs
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter.writeTo(BlobsWriter.java:52)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter.writeTo(BlobsWriter.java:39)
      	at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1
      

      Indeed, MIME specs does not allow multipart content with no body parts.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 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 - 6 hours
                  6h