Open ukalhapu opened 2 months ago
Hi @ukalhapu. Unfortunately we're not actively supporting version 1.x of this SDK. We provide working code samples & active fixes on version 6.x of the SDK. Would it be viable for you to upgrade to version 6.x?
Hi @Ndiritu Thanks for response. No immediate plan to upgrade. Only few of customers are getting this issue, other customers on 1.x not getting the ClassCast exception. We are not able to reproduce in-house. Is there any workaround/configuration ?
Hi @Ndiritu Could you please comment?
Hello @Ndiritu, Customer pushing for resolution. Could you please comment?
Describe the bug
We are trying to upload content to OneDrive root and getting following error consistently.
java.lang.ClassCastException: class java.io.BufferedInputStream cannot be cast to class com.microsoft.graph.models.extensions.UploadSession (java.io.BufferedInputStream is in module java.base of loader 'bootstrap'; com.microsoft.graph.models.extensions.UploadSession is in unnamed module of loader 'app') at com.ptc.cloudstorage.onedrive.OneDriveStorageService$1.success(OneDriveStorageService.java:103) at com.microsoft.graph.concurrency.DefaultExecutors$1.run(DefaultExecutors.java:92) at com.microsoft.graph.concurrency.SynchronousExecutor.execute(SynchronousExecutor.java:45) at com.microsoft.graph.concurrency.DefaultExecutors.performOnForeground(DefaultExecutors.java:89) at com.microsoft.graph.http.CoreHttpProvider$1.run(CoreHttpProvider.java:155) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
Expected behavior
Upload should work as expected.
How to reproduce
try { IAuthenticationProvider authProvider = new AuthenticationProvider(accessToken); // Build a Graph client final IGraphServiceClient graphServiceClient = GraphServiceClient.builder() .authenticationProvider(authProvider) .buildClient(); final BlockingQueue queue = new LinkedBlockingQueue<>(1);
DriveItemUploadableProperties itemProperties = new DriveItemUploadableProperties();
graphServiceClient
.me()
.drive()
.root()
.itemWithPath(escapeSpace(filename))
.createUploadSession(itemProperties)
.buildRequest()
.post(new ICallback() {
@Override
public void failure(final ClientException ex) {
logger.error("createUploadSession.failure: Error occured durring post " + ex);
if (logger.isTraceEnabled()) {
ex.printStackTrace();
}
try {
queue.put("");
} catch (InterruptedException ie) {
}
}
SDK Version
microsoft-graph-core 1.0.9 microsoft-graph 1.9.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```Configuration
No response
Other information
No response