• 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

Servlet response seems to time out

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Running servlets under Jetty.

After uploading a file through JSP, lengthy processing occurs. After an hour, I get the "Internet Explorer cannot display the webpage" displayed. Always exactly an hour after the processing starts. So, I"m pretty sure this is some kind of timeout issue, just not sure where (JVM? jetty? IE? VPN?). I've looked into all the various maxIdleTime settings, etc. in the configuration files that could be the culprit and none are set to an hour (or equivalent seconds/milliseconds).

I've tried turning off the 'friendly HTTP error' setting in IE to get back more info, but still get the same error.

I've also been doing quite a bit of googling and have now ended up here...

Any ideas what default timeout I may be hitting with this?

Any ways, using the HttpServletResponse object, or javascript code to somehow appear not idle, so this timeout doesn't occur?

Any ideas/suggestions are welcome..

thanks,
Tom
 
Tom Katz
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PS: The servlet continues to process in the background, the issue is that the browser returns an error after the 60 minute interval.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Browsers weren't meant to hold connections for a long time.

If your task is going to take a long time (more than 15 seconds) it's better to spawn a new thread for that task, and return right away to a page that can check the status of the process. It's also nice, when doing this, to send an email to the user when the process is done so they don't need to keep their browser open for an hour just to be able to retrieve the task's results.

I have an example application on my site that shows how to do this.
http://simple.souther.us/not-so-simple.html
Look for long running process.
 
Tom Katz
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I'll look into that code. Unfortunately, sending off an email is not an option.

I'd been floating the idea about performing long-running tasks like these in the background, where the user can go to a page and check on what's running, what's queued up, etc - but the client's not set up for that currently.

At the moment, I think I need some kind of hack so that the browser doesn't time out like it does.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only hack I know of is to keep sending packets to the browser so it knows that the response is still active.
 
Tom Katz
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, thanks.

Any ideas on where this hour limit that I'm hitting is coming from? I guess the browser?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep,
Browsers will kill connections that they think are dead.
Your session on the server side could also time out if no requests come in while all of this is taking place.

The default session timeout for most servers is 30 minutes.
 
reply
    Bookmark Topic Watch Topic
  • New Topic