You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Harms <jd...@clarionmag.com> on 2000/07/26 01:30:25 UTC

Using Tomcat 3.2 B2 with VAJava - changes to StopTomcat.java

If you're following Sheldon Wosnick's much-appreciated tutorial on 
using VAJava with Tomcat, you'll need to make a couple of changes to 
StopTomcat.java for proper shutdown. Change

 Class aClass = Class.forName("org.apache.tomcat.shell.Shutdown");

to

 Class aClass = Class.forName("org.apache.tomcat.startup.Tomcat");
        
And change

 Object[] arguments = new Object[] {new String[] {}};

to

 Object[] arguments = new Object[] {new String[] {"-stop"}};

That will pass the -stop parameter to org.apache.tomcat.startup.Tomcat, 
which now handles startup and shutdown. 

FYI.

Dave

Dave Harms
jdev@clarionmag.com


Re: Using Tomcat 3.2 B2 with VAJava - changes to StopTomcat.java

Posted by Tim Kientzle <ki...@acm.org>.
This is something I've been wondering about.  I've been
toying with the idea of adding a shell script that simply
starts Tomcat, waits for it to die, restarts it,... in
an endless loop.  This is mostly a reliability issue, having
Tomcat automatically restart in the event of a problem.

It had occurred to me that this might allow for a servlet
to automatically restart Tomcat.  Can a servlet running
within Tomcat invoke this?  If so, that would be very useful;
I'd like for an administrative servlet to allow a webmaster
to completely restart Tomcat, in the process flushing any stale
cached data, etc.

				- Tim


Dave Harms wrote:
> 
> If you're following Sheldon Wosnick's much-appreciated tutorial on
> using VAJava with Tomcat, you'll need to make a couple of changes to
> StopTomcat.java for proper shutdown. Change
> 
>  Class aClass = Class.forName("org.apache.tomcat.shell.Shutdown");
> 
> to
> 
>  Class aClass = Class.forName("org.apache.tomcat.startup.Tomcat");
> 
> And change
> 
>  Object[] arguments = new Object[] {new String[] {}};
> 
> to
> 
>  Object[] arguments = new Object[] {new String[] {"-stop"}};
> 
> That will pass the -stop parameter to org.apache.tomcat.startup.Tomcat,
> which now handles startup and shutdown.
> 
> FYI.
> 
> Dave
> 
> Dave Harms
> jdev@clarionmag.com