Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Phil E.1's avatar
Phil E.1
New member | Level 2
10 years ago

API v2 java throwing BadResponseException: Bad JSON for uploadSessionFinishBatchCheck

I'm using the UploadSession feature of the java SDK to upload multiple files at once, and at the end of the process when I call files().uploadSessionFinishBatchCheck, I'm getting an exception:

com.dropbox.core.BadResponseException: Bad JSON: expected field 'success', but was: 'name'

 

Full Stack Trace:

com.dropbox.core.BadResponseException: Bad JSON: expected field 'success', but was: 'name'
at [Source: buffer(okio.GzipSource@24c42bed).inputStream(); line: 1, column: 63]
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:112)
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)
at com.luckysoft.nmcd.common.utility.DropboxUtility.uploadAndDeleteFiles(DropboxUtility.java:146)
at com.luckysoft.nmcd.common.tasks.SyncTask.executeUploadQueue(SyncTask.java:480)
at com.luckysoft.nmcd.common.tasks.SyncTask.doSync(SyncTask.java:248)
at com.luckysoft.nmcd.common.tasks.SyncTask.run(SyncTask.java:176)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:279)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: com.fasterxml.jackson.core.JsonParseException: expected field 'success', but was: 'name'
at [Source: buffer(okio.GzipSource@24c42bed).inputStream(); line: 1, column: 63]
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)
... 15 more 

 

I'm using version 2.1.1 of the dropbox java SDK and OkHttp 3.3.1:

compile 'com.dropbox.core:dropbox-core-sdk:2.1.1'
compile 'com.squareup.okhttp3:okhttp:3.3.1'

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Thanks for the report Phil! We're looking into it.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    This should be fixed now in v2.1.2. Please update and let me know if you're still seeing any issues.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!