<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [Java SDK V2] How to do batch upload? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/195979#M8970</link>
    <description>&lt;P&gt;1. Yes, regarding the grouping, the data ingress guide elaborates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Group files that are being uploaded to into one or more batches. A batch can contain up to 1,000 entries. Entries in a batch don’t all have to target the same namespace, but the fewer namespaces involved in a batch, the more efficient committing the batch will be."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you can group files into batches of up to 1,000 files, preferably across as few namespaces as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. There's a sample of using upload sessions with the Java SDK that should be useful here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java#L68" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java#L68&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That doesn't use the batch functionality, but it should be a good starting point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The batch functionality is that instead of calling &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#uploadSessionFinish-com.dropbox.core.v2.files.UploadSessionCursor-com.dropbox.core.v2.files.CommitInfo-" target="_self"&gt;uploadSessionFinish&lt;/A&gt;&amp;nbsp;oncer per file, you can instead call &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#uploadSessionFinishBatch-java.util.List-" target="_self"&gt;uploadSessionFinishBatch&lt;/A&gt;&amp;nbsp;once for up to 1000 files each time. You would then use &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#uploadSessionFinishBatchCheck-java.lang.String-" target="_self"&gt;uploadSessionFinishBatchCheck&lt;/A&gt;&amp;nbsp;to check on the status of that operation.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2016 17:34:00 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2016-11-30T17:34:00Z</dc:date>
    <item>
      <title>[Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/195942#M8968</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make Batch upload work by using JAVA SDK v2. I&amp;nbsp;read this &lt;A href="https://www.dropbox.com/developers/reference/data-ingress-guide" target="_self"&gt;documentation&lt;/A&gt; and&amp;nbsp;tried to&amp;nbsp;perform a batch upload.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a&amp;nbsp;general algorithm,&amp;nbsp;which should use direct HTTP calls.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. First point sais "Group files that are being uploaded to into one or more batches....". I don't know, what exactly is Group to batches, I assume that it is some logical splitting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Then there is this instruction "For each file in a batch, in parallel, call &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start" target="_blank"&gt;/files/upload_session/start&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;So I tried this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;UploadSessionStartUploader uploadSessionStartUploader = dbxClientV2.files().uploadSessionStart();&lt;/PRE&gt;&lt;P&gt;and I got an instance of the UploadSessionStartUploader.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now I don't know, how to use it, because it does not seem to provide any functionality for batch upload.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give me some example, how to do the batch upload?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:27:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/195942#M8968</guid>
      <dc:creator>michal_k</dc:creator>
      <dc:date>2019-05-29T09:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/195979#M8970</link>
      <description>&lt;P&gt;1. Yes, regarding the grouping, the data ingress guide elaborates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Group files that are being uploaded to into one or more batches. A batch can contain up to 1,000 entries. Entries in a batch don’t all have to target the same namespace, but the fewer namespaces involved in a batch, the more efficient committing the batch will be."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you can group files into batches of up to 1,000 files, preferably across as few namespaces as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. There's a sample of using upload sessions with the Java SDK that should be useful here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java#L68" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java#L68&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That doesn't use the batch functionality, but it should be a good starting point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The batch functionality is that instead of calling &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#uploadSessionFinish-com.dropbox.core.v2.files.UploadSessionCursor-com.dropbox.core.v2.files.CommitInfo-" target="_self"&gt;uploadSessionFinish&lt;/A&gt;&amp;nbsp;oncer per file, you can instead call &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#uploadSessionFinishBatch-java.util.List-" target="_self"&gt;uploadSessionFinishBatch&lt;/A&gt;&amp;nbsp;once for up to 1000 files each time. You would then use &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#uploadSessionFinishBatchCheck-java.lang.String-" target="_self"&gt;uploadSessionFinishBatchCheck&lt;/A&gt;&amp;nbsp;to check on the status of that operation.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 17:34:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/195979#M8970</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-11-30T17:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196490#M8994</link>
      <description>&lt;P&gt;I modified the sample into an Unit Test, did the changes you advised, but now I keep getting this error as a result of uploadSessionFinishBatchCheck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;uploadSessionFinishBatchJobStatus={
".tag" : "complete",
"entries" : [ {
".tag" : "failure",
"failure" : {
".tag" : "lookup_failed",
"lookup_failed" : "not_closed"
}
} ]
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code, sorry for the messy state:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    @Test
    public void chunkedUploadFiles() throws Exception {
        // Adjust the chunk size based on your network speed and reliability. Larger chunk sizes will
        // result in fewer network requests, which will be faster. But if an error occurs, the entire
        // chunk will be lost and have to be re-uploaded. Use a multiple of 4MiB for your chunk size.
//        final long CHUNKED_UPLOAD_CHUNK_SIZE = 8L &amp;lt;&amp;lt; 20; // 8MiB
        final long CHUNKED_UPLOAD_CHUNK_SIZE = 15; //in Bytes
        final int CHUNKED_UPLOAD_MAX_ATTEMPTS = 5;

        final String FILE_UPLOADED_BY_PARTS = "FileUploadedByParts.txt";
        String dropboxPath = getDropboxPath(FILE_UPLOADED_BY_PARTS);
        File localFile = createTempFileWithContent(FILE_UPLOADED_BY_PARTS, "The content of the file uploaded by parts 01"); //44B of text


        long size = localFile.length();

        long uploaded = 0L;
        DbxException thrown = null;

        // Chunked uploads have 3 phases, each of which can accept uploaded bytes:
        //
        //    (1)  Start: initiate the upload and get an upload session ID
        //    (2) Append: upload chunks of the file to append to our session
        //    (3) Finish: commit the upload and close the session
        //
        // We track how many bytes we uploaded to determine which phase we should be in.
        String sessionId = null;
        for (int i = 0; i &amp;lt; CHUNKED_UPLOAD_MAX_ATTEMPTS; ++i) {
            if (i &amp;gt; 0) {
                System.out.printf("Retrying chunked upload (%d / %d attempts)\n", i + 1, CHUNKED_UPLOAD_MAX_ATTEMPTS);
            }

            try (InputStream in = new FileInputStream(localFile)) {
                // if this is a retry, make sure seek to the correct offset
                in.skip(uploaded);

                // (1) Start
                if (sessionId == null) {
                    sessionId = tested.files().uploadSessionStart()
                            .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE)
                            .getSessionId();
                    uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;
                    printProgress(uploaded, size);
                }

                UploadSessionCursor cursor = new UploadSessionCursor(sessionId, uploaded);

                // (2) Append
                while ((size - uploaded) &amp;gt; CHUNKED_UPLOAD_CHUNK_SIZE) {
                    tested.files().uploadSessionAppendV2(cursor)
                            .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE);
                    uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;
                    printProgress(uploaded, size);
                    cursor = new UploadSessionCursor(sessionId, uploaded);
                }

                final long remaining = size - uploaded;
                if ((remaining) &amp;gt; 0) {
                    tested.files().uploadSessionAppendV2(cursor)
                            .uploadAndFinish(in, remaining);
                    uploaded += remaining;
                    printProgress(uploaded, size);
                    cursor = new UploadSessionCursor(sessionId, uploaded);
                }


                // (3) Finish
                CommitInfo commitInfo = CommitInfo.newBuilder(dropboxPath)
                        .withMode(WriteMode.ADD)
                        .withClientModified(new Date(localFile.lastModified()))
                        .build();
                UploadSessionFinishArg entry = new UploadSessionFinishArg(cursor, commitInfo);
                final String asyncJobIdValue = tested.files().uploadSessionFinishBatch(newArrayList(entry)).getAsyncJobIdValue();

                while (tested.files().uploadSessionFinishBatchCheck(asyncJobIdValue).isInProgress()) {
                    Thread.sleep(1000);
                }

                final UploadSessionFinishBatchJobStatus uploadSessionFinishBatchJobStatus = tested.files().uploadSessionFinishBatchCheck(
                        asyncJobIdValue);
                System.out.println("uploadSessionFinishBatchJobStatus=" + uploadSessionFinishBatchJobStatus.toStringMultiline());

                return;
            } catch (RetryException ex) {
                thrown = ex;
                // RetryExceptions are never automatically retried by the client for uploads. Must
                // catch this exception even if DbxRequestConfig.getMaxRetries() &amp;gt; 0.
                sleepQuietly(ex.getBackoffMillis());
                continue;
            } catch (NetworkIOException ex) {
                thrown = ex;
                // network issue with Dropbox (maybe a timeout?) try again
                continue;
            } catch (UploadSessionLookupErrorException ex) {
                if (ex.errorValue.isIncorrectOffset()) {
                    thrown = ex;
                    // server offset into the stream doesn't match our offset (uploaded). Seek to
                    // the expected offset according to the server and try again.
                    uploaded = ex.errorValue
                            .getIncorrectOffsetValue()
                            .getCorrectOffset();
                    continue;
                } else {
                    // Some other error occurred, give up.
                    System.err.println("Error uploading to Dropbox: " + ex.getMessage());
                    System.exit(1);
                    return;
                }
            } catch (UploadSessionFinishErrorException ex) {
                if (ex.errorValue.isLookupFailed() &amp;amp;&amp;amp; ex.errorValue.getLookupFailedValue().isIncorrectOffset()) {
                    thrown = ex;
                    // server offset into the stream doesn't match our offset (uploaded). Seek to
                    // the expected offset according to the server and try again.
                    uploaded = ex.errorValue
                            .getLookupFailedValue()
                            .getIncorrectOffsetValue()
                            .getCorrectOffset();
                    continue;
                } else {
                    // some other error occurred, give up.
                    System.err.println("Error uploading to Dropbox: " + ex.getMessage());
                    System.exit(1);
                    return;
                }
            } catch (DbxException ex) {
                System.err.println("Error uploading to Dropbox: " + ex.getMessage());
                System.exit(1);
                return;
            } catch (IOException ex) {
                System.err.println("Error reading from file \"" + localFile + "\": " + ex.getMessage());
                System.exit(1);
                return;
            }
        }

        // if we made it here, then we must have run out of attempts
        System.err.println("Maxed out upload attempts to Dropbox. Most recent error: " + thrown.getMessage());
        System.exit(1);
    }

    private static void printProgress(long uploaded, long size) {
        System.out.printf("Uploaded %12d / %12d bytes (%5.2f%%)\n", uploaded, size, 100 * (uploaded / (double) size));
    }

    private static void sleepQuietly(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException ex) {
            // just exit
            System.err.println("Error uploading to Dropbox: interrupted during backoff.");
            System.exit(1);
        }
    }&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Dec 2016 11:04:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196490#M8994</guid>
      <dc:creator>michal_k</dc:creator>
      <dc:date>2016-12-05T11:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196503#M8995</link>
      <description>&lt;P&gt;I checked the Javadoc and I&amp;nbsp;think, that the problem was in this statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tested.files().uploadSessionAppendV2(cursor).uploadAndFinish(in, remaining);&lt;/PRE&gt;&lt;P&gt;There was the close argument missing, so I think, that correct statement should be this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tested.files().uploadSessionAppendV2(cursor, true).uploadAndFinish(in, remaining);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file is now uploaded to Dropbox, however I have a problem with following statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;while (tested.files().uploadSessionFinishBatchCheck(asyncJobIdValue).isInProgress()) {
   Thread.sleep(1000);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this exception:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParseException.&amp;lt;init&amp;gt;(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;)V
	at com.dropbox.core.stone.StoneSerializer.expectField(StoneSerializer.java:84)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:253)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:205)
	at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:265)
	at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:244)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchResult$Serializer.deserialize(UploadSessionFinishBatchResult.java:124)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:236)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:190)
	at com.dropbox.core.stone.StoneSerializer.deserialize(StoneSerializer.java:66)
	at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:104)
	at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:256)
	at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:97)
	at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1565)
	at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1592)
	...nothing interesting here&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I put breakpoint on the line&amp;nbsp;StoneSerializer.java:84, I found out, that there are two problems, probably bugs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First is, that StoneSerializer is not able to parse the response and second problem is the usage of&amp;nbsp;new JsonParseException, where first argument should be message, not an instance of the JsonParser.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The actual exception message, that is suppressed by this incorrect usage&amp;nbsp;in my case should be:&lt;/P&gt;&lt;PRE&gt;expected field 'success', but was: 'name'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 12:56:23 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196503#M8995</guid>
      <dc:creator>michal_k</dc:creator>
      <dc:date>2016-12-05T12:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196508#M8997</link>
      <description>&lt;P&gt;For some reason I can't see my last reply here, so I'll write it again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed in the Javadoc, that I am probably using the functionality wrong and there is a problem in following statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tested.files().uploadSessionAppendV2(cursor).uploadAndFinish(in, remaining);&lt;/PRE&gt;&lt;P&gt;It should be used with close&amp;nbsp;argument&amp;nbsp;true like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tested.files().uploadSessionAppendV2(cursor, true).uploadAndFinish(in, remaining);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the file is being uploaded to Dropbox well, however following exception is raised from following statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;while (tested.files().uploadSessionFinishBatchCheck(asyncJobIdValue).isInProgress()) {
    Thread.sleep(1000);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParseException.&amp;lt;init&amp;gt;(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;)V
	at com.dropbox.core.stone.StoneSerializer.expectField(StoneSerializer.java:84)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:253)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:205)
	at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:265)
	at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:244)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchResult$Serializer.deserialize(UploadSessionFinishBatchResult.java:124)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:236)
	at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:190)
	at com.dropbox.core.stone.StoneSerializer.deserialize(StoneSerializer.java:66)
	at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:104)
	at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:256)
	at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:97)
	at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1565)
	at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1592)
... nothing interesting here&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there are acually two problems. First of&amp;nbsp;according to my debuger the new JsonParseException&amp;nbsp;should be used in a completely different way, first argument should be an error message.&amp;nbsp;I wonder, how the code is able to compile, it's probably some jackson library missmatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nevertheless the main problem is, that the&amp;nbsp;StoneSerializer.java is not able to parse the message and throws exception where the intended error message should be this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;expected field 'success', but was: 'name'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 13:17:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196508#M8997</guid>
      <dc:creator>michal_k</dc:creator>
      <dc:date>2016-12-05T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196535#M8998</link>
      <description>&lt;P&gt;For some reason I can't see my last reply here, so I'll write it again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed in the Javadoc, that I am probably using the functionality wrong and there is a problem in following statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tested.files().uploadSessionAppendV2(cursor).uploadAndFinish(in, remaining);&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;It should be used with close argument true like this:&lt;/P&gt;&lt;PRE&gt;tested.files().uploadSessionAppendV2(cursor, true).uploadAndFinish(in, remaining);&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Now the file is being uploaded to Dropbox well, however following exception is raised from following statement:&lt;/P&gt;&lt;PRE&gt;while (tested.files().uploadSessionFinishBatchCheck(asyncJobIdValue).isInProgress()) {
    Thread.sleep(1000);
}&lt;/PRE&gt;&lt;PRE&gt;java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParseException.&amp;lt;init&amp;gt;(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;)V
at com.dropbox.core.stone.StoneSerializer.expectField(StoneSerializer.java:84)
at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:253)
at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:205)
at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:265)
at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:244)
at com.dropbox.core.v2.files.UploadSessionFinishBatchResult$Serializer.deserialize(UploadSessionFinishBatchResult.java:124)
at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:236)
at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:190)
at com.dropbox.core.stone.StoneSerializer.deserialize(StoneSerializer.java:66)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:104)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:256)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:97)
at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1565)
at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1592)
... nothing interesting here&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there are acually two problems. First all, it seems, that there are two colliding versions of the com.fasterxml.jackson library (we use the Spring Boot framework).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nevertheless the main problem is, that the StoneSerializer.java is not able to parse the message and throws exception where the intended error message should be this:&lt;/P&gt;&lt;P&gt;expected field 'success', but was: 'name'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 15:56:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196535#M8998</guid>
      <dc:creator>michal_k</dc:creator>
      <dc:date>2016-12-05T15:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196562#M9000</link>
      <description>&lt;P&gt;The not_closed error is &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish_batch-check" target="_self"&gt;documented&lt;/A&gt; as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"The session must be closed before calling upload_session/finish_batch."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is, make sure you close each session, e.g., when using &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_v2" target="_self"&gt;/2/files/upload_session/append_v2&lt;/A&gt;, before calling&amp;nbsp;/2/files/upload_session/finish_batch.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 18:49:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196562#M9000</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-12-05T18:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196616#M9009</link>
      <description>&lt;P&gt;For some reason&amp;nbsp;my posts are disappearing from this thread.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I closed the session like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tested.files().uploadSessionAppendV2(cursor, true).uploadAndFinish(in, remaining);&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Now the file is being uploaded to Dropbox well, however following exception is raised from following statement:&lt;/P&gt;&lt;PRE&gt;while (tested.files().uploadSessionFinishBatchCheck(asyncJobIdValue).isInProgress()) {
    Thread.sleep(1000);
}&lt;/PRE&gt;&lt;PRE&gt;com.dropbox.core.BadResponseException: Bad JSON: expected field 'success', but was: 'name'&lt;BR /&gt; at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@315f43d5; line: 1, column: 63]&lt;BR /&gt; at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:112)&lt;BR /&gt; at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:256)&lt;BR /&gt; at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:97)&lt;BR /&gt; at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1565)&lt;BR /&gt; at com.dropbox.core.v2.files.DbxUserFilesRequests.uploadSessionFinishBatchCheck(DbxUserFilesRequests.java:1592)&lt;BR /&gt;... nothing interesting here&lt;BR /&gt;Caused by: com.fasterxml.jackson.core.JsonParseException: expected field 'success', but was: 'name'&lt;BR /&gt; at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@315f43d5; line: 1, column: 63]&lt;BR /&gt; at com.dropbox.core.stone.StoneSerializer.expectField(StoneSerializer.java:84)&lt;BR /&gt; at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:253)&lt;BR /&gt; at com.dropbox.core.v2.files.UploadSessionFinishBatchResultEntry$Serializer.deserialize(UploadSessionFinishBatchResultEntry.java:205)&lt;BR /&gt; at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:265)&lt;BR /&gt; at com.dropbox.core.stone.StoneSerializers$ListSerializer.deserialize(StoneSerializers.java:244)&lt;BR /&gt; at com.dropbox.core.v2.files.UploadSessionFinishBatchResult$Serializer.deserialize(UploadSessionFinishBatchResult.java:124)&lt;BR /&gt; at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:236)&lt;BR /&gt; at com.dropbox.core.v2.files.UploadSessionFinishBatchJobStatus$Serializer.deserialize(UploadSessionFinishBatchJobStatus.java:190)&lt;BR /&gt; at com.dropbox.core.stone.StoneSerializer.deserialize(StoneSerializer.java:66)&lt;BR /&gt; at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:104)&lt;BR /&gt; ... 36 common frames omitted&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there are acually two problems. I seems it seems, that there are two colliding versions of the com.fasterxml.jackson library (we use the Spring Boot framework).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nevertheless the main problem is, that the StoneSerializer.java is not able to parse the message and throws exception where the intended error message should be this:&lt;/P&gt;&lt;P&gt;expected field 'success', but was: 'name'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 08:21:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196616#M9009</guid>
      <dc:creator>michal_k</dc:creator>
      <dc:date>2016-12-06T08:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196701#M9019</link>
      <description>&lt;P&gt;That looks like a bug that was fixed in version 2.1.2. Please make sure you're using the latest version of the SDK, and let me know if you're still seeing that.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 18:40:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196701#M9019</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-12-06T18:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: [Java SDK V2] How to do batch upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196765#M9031</link>
      <description>&lt;P&gt;My bad, I just followed the installation guide and didn't checke the MVN Repo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 08:40:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-V2-How-to-do-batch-upload/m-p/196765#M9031</guid>
      <dc:creator>michal_k</dc:creator>
      <dc:date>2016-12-07T08:40:17Z</dc:date>
    </item>
  </channel>
</rss>

