Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Using literally exactly the same code as on the GitHub tutorial, I get a ZipException whenever I try to call a method with client.files().
DbxRequestConfig config = DbxRequestConfig.newBuilder("Greysia Bot").build(); DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN); ListFolderResult result = client.files().listFolder("");
[01:48:22] [Thread-37/WARN]: Caused by: java.lang.RuntimeException: Error loading from "/com/dropbox/core/trusted-certs.raw": invalid stored block lengths [01:48:22] [Thread-37/WARN]: at com.dropbox.core.util.LangUtil.mkAssert(LangUtil.java:15) [01:48:22] [Thread-37/WARN]: at com.dropbox.core.http.SSLConfig.loadKeyStore(SSLConfig.java:347) [01:48:22] [Thread-37/WARN]: at com.dropbox.core.http.SSLConfig.createTrustManager(SSLConfig.java:214) [01:48:22] [Thread-37/WARN]: at com.dropbox.core.http.SSLConfig.<clinit>(SSLConfig.java:60) [01:48:22] [Thread-37/WARN]: ... 12 more [01:48:22] [Thread-37/WARN]: Caused by: java.util.zip.ZipException: invalid stored block lengths [01:48:22] [Thread-37/WARN]: at java.util.zip.InflaterInputStream.read(Unknown Source) [01:48:22] [Thread-37/WARN]: at java.util.zip.InflaterInputStream.read(Unknown Source) [01:48:22] [Thread-37/WARN]: at java.io.FilterInputStream.read(Unknown Source) [01:48:22] [Thread-37/WARN]: at java.io.DataInputStream.readUnsignedShort(Unknown Source) [01:48:22] [Thread-37/WARN]: at com.dropbox.core.http.SSLConfig.deserializeCertificates(SSLConfig.java:396) [01:48:22] [Thread-37/WARN]: at com.dropbox.core.http.SSLConfig.loadKeyStore(SSLConfig.java:375) [01:48:22] [Thread-37/WARN]: at com.dropbox.core.http.SSLConfig.loadKeyStore(SSLConfig.java:341) [01:48:22] [Thread-37/WARN]: ... 14 more
Thanks for the report! I just tried this and it's working properly for me, so we'll need to investigate this further. Can you let me know:
I've attempted to fix this various ways by:
Also, I'm getting this exception just before the ZipException
java.lang.ExceptionInInitializerError: null at com.dropbox.core.http.StandardHttpRequestor.prepRequest(StandardHttpRequestor.java:213) ~[?:?] at com.dropbox.core.http.StandardHttpRequestor.startPost(StandardHttpRequestor.java:71) ~[?:?] at com.dropbox.core.http.StandardHttpRequestor.startPost(StandardHttpRequestor.java:29) ~[?:?] at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:276) ~[?:?] at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:146) ~[?:?] at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:330) ~[?:?] at com.dropbox.core.v2.DbxRawClientV2.executeRetriableWithRefresh(DbxRawClientV2.java:351) ~[?:?] at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:137) ~[?:?] at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:2082) ~[?:?] at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:2132) ~[?:?]
Thanks! That should all be fine. I just tried Dropbox Java SDK v3.1.3 loaded by Maven with Java 1.8 in Eclipse on Windows and it worked for me, so there must be something more specific causing this.
The account, app registration, and access token likely shouldn't matter here, as it looks like the app is failing to connect to the Dropbox servers, before any of that would be validated (which happens on the server).
Instead, the issue is with preparing the request, when the SDK reads the file that contains the trusted certificates for the Dropbox API server TLS configuration.
Is there any special setup in your project that may be interfering with loading a local resource like that?
Also, does the "Tutorial Example" work for you? That uses Gradle, so that would be a good test to see if the installation method makes a difference. If that does work, you can try switching that to Maven to see if the issue then reproduces.
Hi, switching to Maven, on that tutorial class, worked perfectly. I'm actually writing a plugin for a minecraft server. That is probably what is causing the issue and interfering with it. I'll try and find a way to get it to work.
I see, thanks for the additional context. It sounds like there is something about that environment that is interfering then. Unfortunately we can't provide support or guidance for working in a plugin like that though. Apologies I can't be of more help in that regard!
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!