Try something like this:

Process p1 = rt.exec("cmd /c start Tomcat.bat");

-----Original Message-----
From: Venkatesh Sangam [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 21, 2001 1:01 PM
To: [EMAIL PROTECTED]
Subject: RE: admin question


Hi Randy.
I am actually trying to execute like this ..

    Runtime rt = Runtime.getRuntime();
    Process pc = null;
    try{
      pc = rt.exec("D:\\Venky\\jakarta-tomcat-3.2.1\\bin\\Tomcat.bat");
   }
        catch (Exception e) { System.out.println("Error Occered");}

But it is still not working ..
I  have no idea as to what the problem is ..
if there is any mistake in this please let me know
thanks
Venkatesh


From: Randy Layman <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: admin question
Date: Mon, 21 May 2001 14:54:39 -0400


        Two thoughts come to my mind immediately:
        1.  Use Runtime.exec to call tomcat.bat/sh - benefit of this is that
it lives in a separate OS thread and the starter can then be started/stopped
independent of Tomcat.  The downside is that the starter needs to know the
values (or how to find them) of Tomcat Home and Java Home.
        2.  Call org.apache....Tomcat.main passing the arguments that would
be set by tomcat.bat/sh.  The benefit of this is that the starter doesn't
need to know how to find the Tomcat/Java home variables.  The downside is
that the starter's JVM is now linked to Tomcat's (thus not allowing the
starter to be restarted without Tomcat, also the starter is tied to the
current method of invoking Tomcat, which could change in the future
releases.

        Randy

 > -----Original Message-----
 > From: Venkatesh Sangam [mailto:[EMAIL PROTECTED]]
 > Sent: Monday, May 21, 2001 1:41 PM
 > To: [EMAIL PROTECTED]
 > Subject: RE: admin question
 >
 >
 > Hi Randy,
 >
 > How do u start a tomcat server using a Java program ??
 > How do I say Net Start <service Name> on the Dos Prompt
 > what is the service name to be specificed
 > If Not is ther any other method to start Tomcat using a Java program
 >
 > thanks
 > Venkatesh
 >
 >
 > From: Randy Layman <[EMAIL PROTECTED]>
 > Reply-To: [EMAIL PROTECTED]
 > To: [EMAIL PROTECTED]
 > Subject: RE: admin question
 > Date: Mon, 21 May 2001 07:05:21 -0400
 >
 >
 >
 >  > -----Original Message-----
 >  > From: Venkatesh Sangam [mailto:[EMAIL PROTECTED]]
 >  > Sent: Friday, May 18, 2001 6:29 PM
 >  > To: [EMAIL PROTECTED]
 >  > Subject: RE: admin question
 >  >
 >  >
 >  > hey the in second option what u suggested  ...
 >  > did u mean that have an application running on the computer
 >  > where the tomcat
 >  > is installed ??
 >  >
 >  > If the tomcat server is physically not accessible then
 > what to do ??
 >
 >      If, by not physically accessible I assume that you mean
 > you can't
 > get to it to install software, write a servlet that will
 > install things on
 > the server.  If you mean that you can't install software,
 > then you are out
 > of luck and will have to rely on the network support of the
 > people running
 > the computer to restart the service for you.
 >  >
 >  >
 >  >
 >  >
 >  > From: Randy Layman <[EMAIL PROTECTED]>
 >  > Reply-To: [EMAIL PROTECTED]
 >  > To: [EMAIL PROTECTED]
 >  > Subject: RE: admin question
 >  > Date: Fri, 18 May 2001 16:08:52 -0400
 >  >
 >  >
 >  >   The problem with this is, how to you restart Tomcat?
 >  >
 >  >   I see two basic choices:
 >  >   1.  Use some other package to remotely control the
 >  > services.  This
 >  > has been the methodology used here for 90% of our projects
 >  >   2.  Write an application that listens to a port for the
 >  > startup/shutdown command.  I did this once and its not to big
 >  > of a deal (but
 >  > I can't give you the source).  The basic structure is:
 >  >   Get Server Socket
 >  >   Read a command (will block until command sent)
 >  >   Process command (some forethought here will make this
 >  > easy to adapt
 >  > to other projects)
 >  >   Repeat
 >  >
 >  >   Really, not a lot to it, however if you get smart and
 >  > start adding
 >  > other features (like cleaning up log files while the service
 >  > is down, doing
 >  > multiple services in a particular order) it can get
 >  > complicated and messy
 >  > without forethought.
 >  >
 >  >   Randy
 >  >
 >  >  > -----Original Message-----
 >  >  > From: Mark Mynsted [mailto:[EMAIL PROTECTED]]
 >  >  > Sent: Friday, May 18, 2001 3:31 PM
 >  >  > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 >  >  > Subject: Re: admin question
 >  >  >
 >  >  >
 >  >  > Could you not create a servlet to run the following?
 >  >  > org.apache.tomcat.startup.Tomcat -stop
 >  >  >
 >  >  > Sincerely yours;
 >  >  >
 >  >  > Mark Mynsted
 >  >  >
 >  >  >
 >  >  >
 >  >  > VHA Management Information Systems Client Services
 >  >  > [EMAIL PROTECTED]
 >  >  > (972) 830 - 0592, Internal x1592
 >  >  >
 >  >  > >>> [EMAIL PROTECTED] 5/18/2001 2:26:14 PM >>>
 >  >  > is there any way to stop/restart the server remotely
 > without telnet
 >  >  > access??  I know I can do a net stop jakarta and net start
 >  >  > jakarta.  Is
 >  >  > there any restart option on the admin console?  Has anyone
 >  >  > written a Java
 >  >  > utilility to do this?
 >  >  >
 >  >  > Thanks,
 >  >  >
 >  >  > Eric Lubin
 >  >  > [EMAIL PROTECTED]
 >  >  >
 >  >  >
 >  >
 >  > ______________________________________________________________
 >  > ___________
 >  > Get Your Private, Free E-mail from MSN Hotmail at
 > http://www.hotmail.com.
 >
 > ______________________________________________________________
 > ___________
 > Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Reply via email to