Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to programatically shutdown Tomcat

Reply
Thread Tools

How to programatically shutdown Tomcat

 
 
iffriganovitch
Guest
Posts: n/a
 
      04-17-2004
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!
 
Reply With Quote
 
 
 
 
Christophe Vanfleteren
Guest
Posts: n/a
 
      04-17-2004
iffriganovitch wrote:

> 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

--
Kind regards,
Christophe Vanfleteren
 
Reply With Quote
 
 
 
 
Daniel Rohe
Guest
Posts: n/a
 
      04-17-2004
Send the string "SHUTDOWN" to port 8005. The shutdown is defined in the
server.xml.

greetings
Daniel

"iffriganovitch" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) om...
> 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!



 
Reply With Quote
 
iffriganovitch
Guest
Posts: n/a
 
      04-19-2004
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.

"Daniel Rohe" <(E-Mail Removed)-ilmenau.de> wrote in message news:<c5r7k6$4qscd$(E-Mail Removed)-berlin.de>...
> Send the string "SHUTDOWN" to port 8005. The shutdown is defined in the
> server.xml.
>
> greetings
> Daniel
>
> "iffriganovitch" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:(E-Mail Removed) om...
> > 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!

 
Reply With Quote
 
Christophe Vanfleteren
Guest
Posts: n/a
 
      04-19-2004
iffriganovitch wrote:

> 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 ???)


You need the java.net package actually.

It's pretty easy if you follow the tutorial:
http://java.sun.com/docs/books/tutorial/networking/

Fast skip to actual writing to a socket:
http://java.sun.com/docs/books/tutor...ngWriting.html

--
Kind regards,
Christophe Vanfleteren
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat Shutdown Unexpectedly zhanngol@yahoo.com Java 1 05-04-2006 04:42 PM
Tomcat 4.1.31 - huge count of webapps, Tomcat hangs up Martin Eberle Java 2 12-03-2004 07:10 PM
Tomcat Web application manager - Virtual host Tomcat 4.30 + Apache2 + JK2 connector with multi IPs Joe Java 0 07-12-2004 03:06 PM
Apache Tomcat 4.1.24: problem with Tomcat Administration link Christos Gravvanis Java 0 07-07-2004 05:21 PM
[TOMCAT] Tomcat crashes %=zerointeractive.it% Java 1 01-22-2004 12:08 PM



Advertisments