Learn how to make the most out of the Dropbox Community here 💙.
Forum Discussion
APITestDAM
8 years agoNew member | Level 2
Exception java.lang.NoClassDefFoundError: Could not initialize class com.dropbox.core.DbxHost
I am creating a Java webapp with dropbox sdk. The code is
StandardHttpRequestor.Config.Builder requestorConfigBuilder = StandardHttpRequestor.Config .builder(); List<Proxy> proxies = ProxySelector.getDefault().select(new URI("https://www.dropbox.com")); for (Proxy proxy : proxies) { requestorConfigBuilder.withProxy(proxy); } StandardHttpRequestor.Config requestorConfig = requestorConfigBuilder.build(); StandardHttpRequestor httpRequestor = new StandardHttpRequestor(requestorConfig); DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder(this.accessToken) .withHttpRequestor(httpRequestor) .build(); return new DbxClientV2(requestConfig, this.accessToken); //exception is thrown from here
The stack trace is
java.lang.NoClassDefFoundError: Could not initialize class com.dropbox.core.DbxHost at com.dropbox.core.v2.DbxClientV2.<init>(DbxClientV2.java:31)
Anyone knows what I did wrong?
- Greg-DB
Dropbox Staff
Your code looks fine at a glance. What version of the SDK do you have installed and how did you install it?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,965 PostsLatest Activity: 10 hours ago
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 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!