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

batch API to upload files via REST is broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.9.4
    • Fix Version/s: 6.0
    • Component/s: Rest API

      Description

      To upload file(s) using REST API, we have to use the "batch API, which is described in the doc and in 2 blogs (there and there) and is summarized here:

      • First, send the file, giving it a batch id and using the /api/v1/automation/batch/upload API:
      • Then, create a new document (POST) and set its file:content to the batch-id and file index

      This works like a charm in 5.9.3 and does not work anymore in 5.9.4. The nuxeo document is created (a File, a Picture, ...), but the file is not bound to the document, the server reports an Unable to find batch with id plane-1.JPG error (in my example, the batch-id is the name of the file, "plane-1.JPG"). See attached log.

      Excerpt:

      2014-06-09 16:57:48,190 ERROR [http-bio-0.0.0.0-8080-exec-4] [org.nuxeo.ecm.webengine.app.WebEngineExceptionMapper] Exception in JAX-RS processing
      java.lang.NullPointerException
      	at org.nuxeo.ecm.webengine.model.impl.AbstractResource.newObject(AbstractResource.java:234)
      	at org.nuxeo.ecm.automation.server.jaxrs.AutomationResource.getBatchManager(AutomationResource.java:149)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: