Mark Eggers wrote:
From: André Warnier <a...@ice-sa.com>
To: Tomcat Users List <users@tomcat.apache.org> Sent: Saturday, April 28, 2012 4:31 AM
Subject: Re: How to run Tomcat as Service on windows start up.

Jacques Desodt wrote:
Hi Kiran,

On Windows 7, you can't run batch files as services.
See :
http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service

Your first step : compile the .bat file into .exe
Then create the service, and after change the service register values with
regedit.
I think that it is a bit more complicated that that.
A .bat file compiled to a .exe will still not work properly as a Windows 
service.

The standard Tomcat installation for Windows does it right, by providing a correct 
"service wrapper" for the JVM which runs Tomcat.
The OP would probably, in the end, save himself some time by installing a 
proper Tomcat-as-a-Windows-service from the Tomcat website, and then arrange 
for Netbeans to talk to that one.


NetBeans will not talk to the service very well.

NetBeans uses the .bat files (.sh on Linux / UNIX) to control Tomcat. From 
within NetBeans you can start, stop, and restart Tomcat, or run it in debug 
mode.

NetBeans will complain that it cannot find the startup.bat and shutdown.bat 
required to do these tasks if you install the service.

Presumably then, you could replace startup.bat and shutdown.bat by similarly-named .bat files which respectively do
net start "Apache Tomcat"
and
net stop "Apache Tomcat"
(to keep it simple)

Similarly, it should be possible to create .bat files which run the Tomcat wrapper tomcatX.exe with the appropriate arguments to start, stop, or run Tomcat in debug mode.

No ?

(Although, if I understood the OP's request correctly, the point here would be to start Tomcat as a service as soon as Windows starts. So presumably, the necessity of having a "startup.bat" is not evident anymore).

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to