You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Information M.
9 years agoNew member | Level 1
Dropbox V2 API Java, Client call on Tomcat fails without any log details
Hi All,
We are facing a really weird problem we can’t seem to get our head’s round. We have developed a simple Java call that will store our local files on our Dropbox account.
We used the V2 API reference code as shown on https://www.dropbox.com/developers/documentation/java#tutorial without to many changes.
The communication is performed based on the App token we have generated for the app on the OAuth 2 “Generated Access Token” section.
Running the app locally works just fine without issues, we are perfectly able to upload files to the Dropbox account.
However when we deploy the app to a Tomcat server to run attended on our server the process fails for no given reason.
On Client call the API code is performed, skips some code (which it does not do on the local developer machine) and then simply returns without any warning or issue.
No files are however uploaded.
Although we have tried lots of stuff we can’t seem to figure out what is going wrong exactly.
Is there anybody that could point us in the right direction?
Environment: Tomcat 8.0
JDK: 1.7_72
API V2: 2.0.3
- Greg-DBDropbox Staff
Unfortunately there's not much to go on here. Can you elaborate on what you mean when you say "the process fails for no given reason". Are you basing that just on the lack a new file in your account? (Also, note that if you upload the same exact data to the same path, that won't create a new revision.)
Anyway, I wouldn't expect something to fail without some error somewhere, but lacking that, I would check that the source file exists and is accessible to the process.
- Information M.New member | Level 1
Hi Gregory,
Thanks for the reply.
During testing I've cleared the dropbox account between tests as I did notice that files wouldn't be overwritten, so this isn't the cause of our problem.
During development I ran the code using a unit test. It retrieved the test file from an FTP server changed its name (adding a timestamp to prevent duplicate names) and then uploaded this file to the dropbox account. So far so good.
Once I had completed the development of the required code I performed a test on a locally running tomcat 8 server. This is where the strangeness starts.
The following code simply won't execute properly:
private DbxClientV2 getDropboxClient(String authToken) throws ProcessFailedException{
log.debug("getDropboxClient");
try{
//Create the Dropbox connection client
DbxRequestConfig config = new DbxRequestConfig("xxxxxxxxxxxxx", "nl_NL");
DbxClientV2 client = new DbxClientV2(config, passwordEncryptionService.decryptPassword(authToken));
return client;
} catch (Exception e){
throw new ProcessFailedException(e);
}
}The DbxRequestConfig is created but once I try to initialize the DbxClientV2 nothing happens. No exceptions are thrown, no messages are displayed in the log. As far as I can see the call to dropbox isn't ever made.
- Greg-DBDropbox Staff
The code you shared doesn't make an API call to Dropbox, it just creates and returns the client you would use to make calls. What do you mean it doesn't run properly? Presumably you're calling getDropboxClient somewhere. What gets returned?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 19 hours agoIf 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!