• 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

503 error code for Tomcat.

 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic