cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Get summer ready with Dropbox basic - travel documents, plans, progress reminders and more, right over here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ZipException

ZipException

Visualizeding
Explorer | Level 3

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
5 Replies 5

Re: ZipException

Greg-DB
Dropboxer

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:

  • what operating system and version are you seeing this with?
  • what version of Java are you seeing this with?
  • what version of the Dropbox Java SDK are you seeing this with?
  • how did you install the Dropbox Java SDK?

Re: ZipException

Visualizeding
Explorer | Level 3
  • I'm using the Windows 10 operating system, it should be the latest version of it.
  • Java Version: 1.8.0_151 (according to Eclipse)
  • I'm using the Dropbox SDK core version 3.1.3. 
  • I'm using Maven, to use the SDK as a dependency in my project.

I've attempted to fix this various ways by:

  1. Creating a new account (then creating a new app in the app console)
  2. Regenerating the access token
  3. Deleting dropbox from my local repository

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) ~[?:?]

Re: ZipException

Greg-DB
Dropboxer

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.

Re: ZipException

Visualizeding
Explorer | Level 3

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. 

Re: ZipException

Greg-DB
Dropboxer

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!

Poll
Which Dropbox Plan do you have?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Visualizeding Explorer | Level 3
What do Dropbox user levels mean?
Need more support?