This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Tomcat and the fly likes 503 error code for Tomcat. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "503 error code for Tomcat." Watch "503 error code for Tomcat." New topic
Author

503 error code for Tomcat.

Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2300
How can I get a 503 status code in tomcat.503 means - service not available , but how can I achieve this in tomcat.Do I have to configure MBeans for making individual services unavailavble and avaialble again without shuting down the tomcat and remotely.


Rahul Bhattacharjee
LinkedIn - Blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35247
    
    7
One of the conditions where 503s happen is if there are more clients accessing a server than it can handle, e.g. if its thread pool is exhausted.

If you want to send 503s from your web app, you can do so with the HttpServletResponse methods setStatus and sendError.


Android appsImageJ pluginsJava web charts
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2300
If I want to do something like this...I want to have a service registry and control the registry using an mBean.
And getRegistry would check in the cache whether the service is available or not and the cache can be controlled by the mBean.

boolean serviceAvailable = getRegistry(serviceName);
if(serviceAvailable == fasle)
//send errorCode 503
else
//continue
[ November 27, 2006: Message edited by: Rahul Bhattacharjee ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 503 error code for Tomcat.
 
Similar Threads
Individual Tomcat 503 error-page
customize 503 error page in IIS Tomcat configuration
Apache Tomcat - HTTP Status 503 - Servlet SendMailServlet is currently unavaila
Why is Apache serving the uncompiled page?
Apache-Tomcat 500 and 503 Errors.