Tomcat config problem? infinite wait on 10+ minute servlet calls
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   hank_khang
Posted On:   Friday, March 7, 2003 02:31 AM

I have a (linux-hosted) servlet which runs for as long as 15+ minutes sometimes. However, when it goes over some threshhold around 595,000 milliseconds (just under 10 minutes - sounds like a default timeout?) - the client call NEVER RETURNS - whether the client is Internet Explorer (the globe keeps spinning forever) or from my java client program (below). To narrow the problem I reduced the servlet to a one line "wait X milliseconds" to be sure it wasn't something strange on the server side. But the same thing happens - I get NO ERROR MESSAGES- no timeouts, no page not found, no exceptions - just INFINITE WAIT. I know from System.out.print's that the servlet does reach the last line of the servlet. (The tomcat session-t   More>>

I have a (linux-hosted) servlet which runs for as long as 15+ minutes sometimes.
However, when it goes over some threshhold around 595,000 milliseconds (just under 10 minutes - sounds like a default timeout?) - the client call NEVER RETURNS - whether the client is Internet Explorer (the globe keeps spinning forever) or from my java client program (below). To narrow the problem I reduced the servlet to a one line "wait X milliseconds" to be sure it wasn't something strange on the server side. But the same thing happens - I get NO ERROR MESSAGES- no timeouts, no page not found, no exceptions - just INFINITE WAIT.




I know from System.out.print's that the servlet does reach the last line of the servlet. (The tomcat session-timeout parm is set to -1, though I think this handles something else and not long calls.) I am including client and server code below.




Any help appreciated.


Hank




sample URL : http://IPADDRESS:8080/itsapi/ts?WAITTIME=597000


with this param at 595000 and below everything works - from the browser - from the program, at 597000 and up however it waits forever.







CLIENT CODE





URL myURL = new URL("http://IPADDRESS:8080/itsapi/ts?WAITTIME=597000");
HttpURLConnection httpCon = (HttpURLConnection) myURL.openConnection(); if (httpCon.getResponseCode() != HttpURLConnection.HTTP_OK)
throw new Exception("error url [" + sURL + "] : " +
httpCon.getResponseMessage());




// SERVER WAIT HAPPENS HERE - NEVER GET TO THE LINE BELOW ON > 597,000 ms // at < 595,000 - waits X minutes and then gets to the line below, completing OK




InputStream is = httpCon.getInputStream();






SERVER CODE


public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
try {
PrintWriter out = res.getWriter();
int iWaittimeMS = Integer.parseInt ( req.getParameter ( "WAITTIME"
) );
Thread.sleep( (long) iWaittimeMS) ;
System.out.println("WAITCOMPLETED : " + iWaittimeMS);
out.println(" " + iWaittimeMS + " ");
return;
} catch ( Exception e ) { LogError (e); }

   <<Less

Re: Tomcat config problem? infinite wait on 10+ minute servlet calls

Posted By:   rajeev_kumar  
Posted On:   Friday, March 7, 2003 09:13 AM

check deault server timeout, and inccrease the same, it should be present in server.xml or u can specify the same in web.xml of ur application check the session timeout on the google for tags to be placed in web.xml
About | Sitemap | Contact