crashing a Servlet

Discussion in 'Java' started by Roedy Green, Jun 18, 2004.

  1. Roedy Green

    Roedy Green Guest

    Is there an official way to shutdown a Servlet so that it will load
    new code? It seems that an uncaught NullPointerException will do it,
    but that seems a little hokey.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 18, 2004
    #1
    1. Advertising

  2. Roedy Green

    Dan Gravell Guest

    Roedy Green wrote:
    > Is there an official way to shutdown a Servlet so that it will load
    > new code? It seems that an uncaught NullPointerException will do it,
    > but that seems a little hokey.
    >


    Don't understand the question. How do you mean load new code? The
    Servlet class has a shutdown() method although that's called by the
    container normally.
     
    Dan Gravell, Jun 18, 2004
    #2
    1. Advertising

  3. Roedy Green

    sks Guest

    "Roedy Green" <> wrote in message
    news:eek:...
    > Is there an official way to shutdown a Servlet so that it will load
    > new code? It seems that an uncaught NullPointerException will do it,
    > but that seems a little hokey.


    Do you mean getting the container to reload the servlet after you've made
    changes? If so, that's down to your container config. Tomcat allows you to
    set a reload scan time, which you can set to say 2s while developing, and 5
    minutes otherwise.
     
    sks, Jun 18, 2004
    #3
  4. On Fri, 18 Jun 2004 05:46:21 GMT, Roedy Green
    <> wrote:

    > Is there an official way to shutdown a Servlet so that it will load
    > new code? It seems that an uncaught NullPointerException will do it,
    > but that seems a little hokey.
    >


    Tomcat has a "Manager Application" that lets you force a given
    application to be reloaded, plus a variety of other functions such as
    showing how many current sessions an application has.

    Its all documented in the Tomcat distribution.

    Bill

    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/




    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
     
    William Brogden, Jun 18, 2004
    #4
  5. Roedy Green <> wrote in message news:<>...
    > Is there an official way to shutdown a Servlet so that it will load
    > new code? It seems that an uncaught NullPointerException will do it,
    > but that seems a little hokey.


    I would expect that not only is hokey, but it's probably highly
    container specific.

    Unfortunately, everything about this question is going to be
    container-specific anyway. There are some containers that auto-detect
    new versions of servlet code and load it without you having to do
    anything except drop the new class file in place. (And this may only
    work if you have naked .class files in WEB-INF, no jars)

    Many containers give you a way to restart an individual web
    application from the command line or through some kind of admin
    servlet. Still others, you just plain have to shut down the entire
    server.
     
    Jeff Robertson, Jun 18, 2004
    #5
  6. Roedy Green

    Roedy Green Guest

    On Fri, 18 Jun 2004 08:57:25 +0100, Dan Gravell
    <> wrote or quoted :

    >
    >Don't understand the question. How do you mean load new code? The
    >Servlet class has a shutdown() method although that's called by the
    >container normally.


    The problem is often I change the code for a servlet. What I want to
    happen in for Resin to notice, shut down the old servlet and start up
    the new one. It often does this all by itself, but often it simply
    refuses to notice. Sometimes even stopping and starting the service
    will not suffice.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 18, 2004
    #6
    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. Andy Fish
    Replies:
    4
    Views:
    2,427
    Andy Fish
    Dec 17, 2003
  2. Sean Clarke
    Replies:
    1
    Views:
    1,905
    Sudsy
    Jan 7, 2004
  3. circuit_breaker
    Replies:
    2
    Views:
    2,024
    Jack Jia
    Apr 4, 2004
  4. chamikara
    Replies:
    1
    Views:
    49,882
  5. DiscoStu
    Replies:
    0
    Views:
    507
    DiscoStu
    Jul 8, 2004
Loading...

Share This Page