Skip to content

ClassCastException when using BoxFolder.uploadLargeFile() #1173

@AkihiroAsami

Description

@AkihiroAsami

Description of the Issue

When executing chunk upload by using BoxFolder.upload LargeFile(),
ClassCastException is raised often like the error stack as the following.
This “often” means that sometimes the process completes successfully, sometimes I get this error.

Cause of the bug

Please see this file.

Error Message, Including Stack Trace

Exception in thread "main" com.box.sdk.BoxAPIException: Unable to commit the upload session
at com.box.sdk.LargeFileUpload.uploadHelper(LargeFileUpload.java:204)
at com.box.sdk.LargeFileUpload.upload(LargeFileUpload.java:119)
at com.box.sdk.BoxFolder.uploadLargeFile(BoxFolder.java:1189)
at boxapp.UploadLargeTest2.main(UploadLargeTest2.java:28)
Caused by: java.lang.ClassCastException: class com.box.sdk.BoxAPIResponse cannot be cast to class com.box.sdk.BoxJSONResponse (com.box.sdk.BoxAPIResponse and com.box.sdk.BoxJSONResponse are in unnamed module of loader 'app')
at com.box.sdk.BoxJSONRequest.send(BoxJSONRequest.java:106)
at com.box.sdk.BoxJSONRequest.send(BoxJSONRequest.java:17)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:347)
at com.box.sdk.BoxJSONRequest.send(BoxJSONRequest.java:101)
at com.box.sdk.BoxFileUploadSession.commit(BoxFileUploadSession.java:192)
at com.box.sdk.LargeFileUpload.uploadHelper(LargeFileUpload.java:201)
... 3 more

Versions Used

Java SDK:4.1.1

Metadata

Metadata

Labels

bugAdded to issues that describes SDK bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions