• 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:

SocketTimeout Exception

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am getting this exception while calling a webservice to collect the data from the server. In my I am tryin maximum of 3 times to collect the data. But sometimes code is taking more than usual time to do the updation and throwing this exception. I am not able to find out the reasons behind this.
It would be a great help if anybody can suggest me the reasons behind this.
 
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would guess that you have two options:

1. Refactor the web server so it collects and sends it back faster

2. Change the duration of the timeout on the client to either 0(no timeout) or something higher than it is right now.
 
Amit Madhoriya
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This exception is stalling the processing of the application at the point it is occuring. What can I do so that my application doesn't freeze, crash or hang because of this exception. Instead application should carry on processing the next functionality. Any idea will be helpful for me.
[ August 04, 2008: Message edited by: Amit Madhoriya ]
 
Rusty Shackleford
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don't care that the exception occurred and want to carry on, then catch it at some point after the exception is thrown, and keep going.

At whatever point in your program that makes sense, put in a try/catch. In the catch you will likely want to make a note that it failed so whatever comes next during the execution, the program won't assume that it was successful.

If you could post code it would be easier to be more specific.
 
Amit Madhoriya
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Here is the method in which I am getting this exception. Application is throwing this exception while trying again after timeout. It is trying maximum of three times.

Whenever this exception is occuring ... the application is freezing and its not allowing next task in the list to run. I am not able to figure out exactly at which line I should catch the exception. Any suggestions will be helpful for me.
 
Greenhorn
Posts: 28
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amit,

Do you see any error/exceptions in application logs while you get this?You may get some information in there. Also try to print full stack trace using print stack trace method.

You can also want to see the server logs and see for some errors
[ August 05, 2008: Message edited by: vignesh bala ]
 
Amit Madhoriya
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Please provide some suggestion to my problem ... It will be helpful for me.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen it happen that a web service will run (seemingly) forever in some instances.

You might investigate using a Stub to set a timeout property so that you can control how long it takes - very useful for testing.

Assuming you are using Axis 1 1.x...
http://ws.apache.org/axis/faq.html#faq17

If you are using Axis 2, then you'll have to Google that yourself. I've only used Axis 1
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic