How to programatically shutdown Tomcat

Discussion in 'Java' started by iffriganovitch, Apr 17, 2004.

  1. 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!
     
    iffriganovitch, Apr 17, 2004
    #1
    1. Advertisements

  2. 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
     
    Christophe Vanfleteren, Apr 17, 2004
    #2
    1. Advertisements

  3. iffriganovitch

    Daniel Rohe Guest

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

    greetings
    Daniel

    "iffriganovitch" <> schrieb im Newsbeitrag
    news:...
    > 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!
     
    Daniel Rohe, Apr 17, 2004
    #3
  4. 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" <-ilmenau.de> wrote in message news:<c5r7k6$4qscd$-berlin.de>...
    > Send the string "SHUTDOWN" to port 8005. The shutdown is defined in the
    > server.xml.
    >
    > greetings
    > Daniel
    >
    > "iffriganovitch" <> schrieb im Newsbeitrag
    > news:...
    > > 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!
     
    iffriganovitch, Apr 19, 2004
    #4
  5. 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/tutorial/networking/sockets/readingWriting.html

    --
    Kind regards,
    Christophe Vanfleteren
     
    Christophe Vanfleteren, Apr 19, 2004
    #5
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. %=zerointeractive.it%

    [TOMCAT] Tomcat crashes

    %=zerointeractive.it%, Jan 22, 2004, in forum: Java
    Replies:
    1
    Views:
    574
    Erwin Moller
    Jan 22, 2004
  2. Christos Gravvanis
    Replies:
    0
    Views:
    2,270
    Christos Gravvanis
    Jul 7, 2004
  3. Joe
    Replies:
    0
    Views:
    1,922
  4. Martin Eberle
    Replies:
    2
    Views:
    990
  5. Katerina McLean
    Replies:
    1
    Views:
    3,341
    Juha Laiho
    Dec 10, 2004
  6. Rakesh Pandit
    Replies:
    0
    Views:
    666
    Rakesh Pandit
    Jul 12, 2005
  7. Stewart
    Replies:
    3
    Views:
    3,909
    Stewart
    Aug 18, 2005
  8. Replies:
    1
    Views:
    1,008
    Rhino
    May 4, 2006
Loading...