How to programatically shutdown Tomcat

I

iffriganovitch

Hi,

In my webapp, I want to shutdown Tomcat in case something went wrong
during initialisation (a few things are loaded and checked in a
startup listener).

How can I PROGRAMATICALLY tell tomcat to shutdown?!

Thanks!
 
C

Christophe Vanfleteren

iffriganovitch said:
Hi,

In my webapp, I want to shutdown Tomcat in case something went wrong
during initialisation (a few things are loaded and checked in a
startup listener).

How can I PROGRAMATICALLY tell tomcat to shutdown?!

Thanks!

You could take a look at the source for the management console, and see how
it's done there.

You could always use System.exit() ofcourse, but that's probably not a good
idea :)
 
D

Daniel Rohe

Send the string "SHUTDOWN" to port 8005. The shutdown is defined in the
server.xml.

greetings
Daniel
 
I

iffriganovitch

Thanks for your answer -

I am not good in Java unfortunatly :-/

Do you have a snipet ob how to send such a message on a port in JAVA
(it uses the java http package I guess ???)

Thanks again for your help.
 
C

Christophe Vanfleteren

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top