cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Exception java.lang.NoClassDefFoundError: Could not initialize class com.dropbox.core.DbxHost

Exception java.lang.NoClassDefFoundError: Could not initialize class com.dropbox.core.DbxHost

APITestDAM
New member | Level 2

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?

1 Reply 1

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?
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?