• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange prob with communication between co-located web apps - SocketTimeoutException: Read timed out

 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiya,

We have a front end Java web app, and a back end Java web app. The front end web app makes requests (using HttpURLConnection) from the back end web app.

When the two web apps are located on different servers, everything is fine. However, when we put them on the same server, we are getting "SocketTimeoutException: Read timed out" when we have 5 or more simultaneous HttpURLConnections.

We're using the GlassFish container (glassfish-installer-v2.1.1-b31g-linux.jar), but don't have much idea what the problem is. Here is our HttpURLConnection code used in the front end web app...



...as you can see, the method returns a HttpURLConnection, but that connection is always closed (in a 'finally' block), so what could the problem be?

I'm going to try putting this code in a new Thread but, apart from that, does anyone have any ideas, suggestions or explanations?!

Thanks in advance,
James
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know when I use Websphere, the default is to disallow outbound socket connections, and it's necessary to include a policy file with the web application if it has to do that. Quite possibly that's a standard Java EE rule and you would have to do the same sort of thing with your Glassfish installation.

Unfortunately I haven't used Glassfish so I couldn't start to tell you how to do that, if indeed that's your problem.
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiya Paul,
The outbound connections are fine - it's when the connections are made to localhost that we have the problem... but the problem only occurs when there are 6 or more simultaneous requests to localhost...
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic