aspose file tools*
The moose likes Tomcat and the fly likes Server cannot be reached after 5 minutes into the request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Server cannot be reached after 5 minutes into the request" Watch "Server cannot be reached after 5 minutes into the request" New topic
Author

Server cannot be reached after 5 minutes into the request

Pradyumna Nandavanam
Greenhorn

Joined: Apr 05, 2011
Posts: 2
Hi,

I have a Website that generates reports. I enter the input and press 'Generate Report' button. The generation of the report(just one request) takes nearly 30 minutes. I am using ExtJS, Mysql and Tomcat server in my project.

When I hosted the project in my desktop it worked fine. But, when I hosted it in a remote server (within my organization), the request to generate report gives a 400 Bad Request response. Moreover, this response from the server comes exactly 5 minutes after the request was sent. I checked the log files in the server to find no signs of any errors or even warnings.

At the client side(browser) error message says, "400 Bad Request...We can not connect to the server you have requested." My guess is that the Network or the firewall is configured some-how to timeout any request that lasts for more than 5 minutes.

Please let me know if anyone has faced this problem.

Thank you,
Pradyumna Nandavanam
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

That is far too long to let a request go on. Launch the report generation as a background process and return a response right away. Give the user a way to go back and check the completion of the task.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pradyumna Nandavanam
Greenhorn

Joined: Apr 05, 2011
Posts: 2
Thank you for getting back to me.

Is there no other way to tackle this issue? I mean, is there a security setting that I can change to allow the request to be treated as valid even if it takes a long time?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

Pradyumna Nandavanam wrote:Thank you for getting back to me.

Is there no other way to tackle this issue? I mean, is there a security setting that I can change to allow the request to be treated as valid even if it takes a long time?


It wouldn't be security. But HTTP isn't designed for long-running operations anymore that it's designed for full client/server communications. HTTP is about quick in-and-out processing. If you want something that takes a long period of time, you should hand it over to something that runs in a long-term environment and only use HTTP to submit requests, get status, and possibly modify processing (for example, "cancel").

Even if you force the server to operate in the way you want, it won't operate optimally. The webapp server has finite resources and long-running requests tie them up and make them unavailable to everyone else.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server cannot be reached after 5 minutes into the request