Server error when attaching large blob file

This is the error message that I get when attaching large blob file in a Document.

02:01:12.922 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Connection<-> closed 02:01:12.922 [main] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection released: [id: 3][route: {}->][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20] 02:01:12.922 [main] INFO tv.migo.transcode.util.RESTUtils - org.nuxeo.ecm.automation.client.RemoteException: Server Error 02:01:12.922 [main] INFO tv.migo.transcode.util.RESTUtils - uploading failed.

This is my code from

HttpAutomationClient automationClient = new HttpAutomationClient(“”);

    Session session = automationClient.getSession("Administrator", "Administrator");

    try {
        // Get The Root
        Document root = (Document) session.newRequest("Document.Fetch").set("value", destinationPath).execute();

        // Create a File Document
        Document documentFolder = (Document) session.newRequest("Document.Create").setInput(root).set("type", "asset").set("name", filename)
                .set("properties", "dc:title=" + TRANSCODED_DIR).execute();
        // Create a File Document
        Document document = (Document) session.newRequest("Document.Create").setInput(documentFolder).set("type", "File").set("name", filename)
                .set("properties", "dc:title=" + filename).execute();

        // Upload The file
        FileBlob fb = new FileBlob(file);
        // uploading a file will return null since we used HEADER_NX_VOIDOP
        session.newRequest("Blob.Attach").setHeader(Constants.HEADER_NX_VOIDOP, "true").setInput(fb).set("document", document.getPath()).execute();"Done!");
        automationClient.shutdown();"uploading success");
        return document;
    } catch (Exception e) {;
    }"uploading failed.");

This code works on smaller size file. I'm wondering if its the Connection-keep-alive should be set true. But how do I do that on Automation Client?

0 votes

0 answers




Which Nuxeo server version do you use? Just in order to reproduce correctly.


5.9.3 is the version. Tomcat is the server used.

Do the same file uploads work correctly via the Nuxeo user interface?

Yes. The web gui works. I can also upload small size files via blob attach in automation client.

Weird. If you change; in your error handler to print the entire stacktrace and original exception, maybe the cause will be more clear. Really the try/catch does nothing for you in this snippet, so an alternative to printing the whole trace is to just remove the try/catch.