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. Advertising

  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. Advertising

  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. Advertising

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. Robert May

    Shutdown a single ASP.net process.

    Robert May, Oct 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    Alvin Bruney
    Oct 19, 2003
  2. JBMC

    Cannot shutdown W3SVC

    JBMC, May 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    6,821
  3. Pint

    prevent application shutdown

    Pint, Mar 16, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    2,047
    Brock Allen
    Mar 17, 2005
  4. Micha³ Januszczyk

    cache clearing upon app shutdown

    Micha³ Januszczyk, Jun 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    401
    Micha³ Januszczyk
    Jun 30, 2005
  5. Replies:
    1
    Views:
    891
    Rhino
    May 4, 2006
Loading...

Share This Page