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

When I develop, I normally don't run Tomcat as a service. However, there are 
some systems where I need to run the service as well as develop. Here's what I 
do.

1. Install my primary Tomcat as a service

I usually make an Apache directory, and then start installing Tomcat underneath 
that.

I do not register this Tomcat with NetBeans since NetBeans cannot really 
control it properly.

2. Install development Tomcats

I then download the zip files for as many different versions of Tomcat as I 
need. Each gets unzipped and put in its own directory under the Apache 
directory.

3. Edit files

a. Service Tomcat
   Leave ports at 8080 in server.xml

   Edit tomcat-users.xml to set up manager-gui access

b. Non-service Tomcats
   Change shutdown port to be something different than the default 8005
   Change HTTP port to something different - 8090 perhaps
   Edit tomcat-users.xml to set up manager-script for NetBeans
      If this is pre-7 Tomcat, set up manager for NetBeans

4. Register Tomcats with NetBeans

Only register those Tomcats with NetBeans that you've installed by unzipping. 
Do not register the service Tomcat with NetBeans.

When you're developing, use the registered (non-service) Tomcats. When you want 
to run an application outside of NetBeans, use the manager application to 
deploy the web application to the service Tomct. The WAR file (from NetBeans' 
build command) will be found in Project-Name\dist.

This works for me. I have three Tomcats ( 5.5.35, 6.0.35, 7.0.27) registered 
with netBeans 7.1.1 (soon to be 7.1.2). I have a service Tomcat (7.0.27) 
running separately.

. . . . just my two cents.
/mde/

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

Reply via email to