Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6775517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:54:58+00:00 2026-05-26T15:54:58+00:00

Scenario: Apache Tomcat 6.0 is started as a service on Windows Server 2008 R2

  • 0

Scenario:

Apache Tomcat 6.0 is started as a service on Windows Server 2008 R2 using a wrapper (org.tanukisoftware.wrapper.WrapperStartStop) which uses org.apache.catalina.startup.Bootstrap. In course of the Tomcat startup one web application is also started.
This web application needs to connect to a remote database and check the connection. It retries to connect a couple of times if the database is not available and then shutdown after x tries.

Problem:

I need to stop Apache Tomcat after the web app exits when the database connection is not available.

Possible solutions:

  • Stop Apache Tomcat from within the web application (already tried the shutdown port which did not work because the connection was refused – with a standalone Java application it worked)
  • Call an external Java application from within the web application
  • Configure Apache Tomcat to shut down if the only web application shuts down – I could not find a way to do that

Any ideas? Maybe a different approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:54:58+00:00Added an answer on May 26, 2026 at 3:54 pm

    System.exit(0) from within your webapp will shut down the Tomcat instance if there is no security manager configured.

    Works from a standalone server, not sure whether it works when running as a Windows service.

    Edit: though you might want to read this: Calling System.exit() in Servlet's destroy() method

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: Apache Wicket based web application running on Tomcat server. User opens URL in
My Apache Tomcat Server is getting periodic updates from a Java based client Application,
I'm using Apache ProxyPass to pass some requests from my server (1) to another
I am using a web application deployed in Apache Tomcat webserver where I am
Scenario is that we send out thousands of emails through SMTP server. Content is
I have a scenario where I have to invoke some functions using XML RPC.
I have installed Apache Axis2 1.6.1 in a Jetty 8.0.4 web server, but JSON
I am using JSF 1.2 + Facelets + Apache My Faces without Tomahawk or
Any examples, tips, guidance for the following scenario? I have used Apache HttpClient to
After enabling gzip compression in my Apache server (mod_deflate) I found consistently that end

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.