• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Amazon S3 issue in web applications

 
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, I made another post about this on SO, but ended up with no results - http://stackoverflow.com/questions/31176998/amazon-s3-issue-in-web-applications


Please have a look at the below code.


I am using this code to list the buckets I have in amazon s3. However this process is extremely slow, it takes almost 1 minute or more. Not only that, this takes lot of memory, almost freezing the Google Chrome. My bucket is in US standard region and my application is running in a PC located in south asia.

The delay is in connection configuration. I noticed this is not taking any time delays when it is running in non web java applications. I ran this in a simple `Main` class which is not web based, and it worked fine, fast.

I am using Netbeans IDE and the above code is a part of a servlet. The server I am using is apache tomcat 7.

Any ideas why this is taking this much of time? I added all the JAR files came with Amazon SDK for Java as well. It has no use to me if this takes this long.
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As already pointed out in the SO thread, you are not writing any response back to the browser.
What are the timestamps of the console messages "I am in" and "done" when running as web app? Is their difference much higher compared to that in the console application?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should build and test your S3 access in a separate class rather than in a servlet. Much easier to debug that way.

Bill
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't matter that I am not writing back to the browser, because I can see what is happening in console and I do have set console messages. Regarding writing the s3 thing in another class and calling It via the servlet I have tried that thing too. It has the same situations as the thing what you can see here. I am wondering whether this is related to apache. I think this is either to relates to apache, localhost or xampp
 
reply
    Bookmark Topic Watch Topic
  • New Topic