I have simple Spring J2EE web application application hosted on Websphere in test environment. We have some stored procedures which takes more than 1 min sometimes. In such scenario, server is returning 500 Internal server error page
while firing ajax call. If total response time is less than 1 min it works fine.
When we run same application on our local on tomcat server, it goes not throw 500, instead returns response even if our code takes more that 2 minutes. But it fails on Websphere server.
I have tested by adding sleep in both servers tomcat at local and Websphere on Test environment, it fails at Test environment. It seems there is some timeout setting on websphere.
I also tried adding following custom properties in web container setting under application server:
Below is content of html I am getting:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">↵<html><head>↵<title>500 Internal Server Error</title>↵</head><body>↵<h1>Internal Server Error</h1>↵<p>The server encountered an internal error or↵misconfiguration and was unable to complete↵your request.</p>↵<p>Please contact the server administrator,↵ [email protected] and inform them of the time the error occurred,↵and anything you might have done that may have↵caused the error.</p>↵<p>More information about this error may be available↵in the server error log.</p>↵</body></html>
This problem is fixed by increasing the ServerIOTimeout in plugin-cfg.xml .
ServerIOTimeout means "how long should the plug-in wait for a response from the application" in seconds. After the socket is opened, the plug-in sends the request to the Application Server. Its default value is 60 in Websphere 7 which is very less for some cases. Important point to not is , once you edit plugin-cfg.xml. You need to regenerate plugin for change to take effect. And other thing is that even if you change it in admin console, it reads it from plugin-cfg.xml if it is present there, so always directly change the xml file.
Location for this file :-
For details,refer IBM DOCS and this really good blog.