Apache Tomcat startup issue in Windows

D

Darren.Kukulka

Hi All,

Running Apache-Tomcat 5.5.15 on a Win2K3 server using the startup.bat
and shutdown.bat scripts supplied with the ZIP distribution of Tomcat.

We are using this because it seems many of the JAVA_OPTS parameters
that can be set in the Java tab of the service control mechanism for
Tomcat are ignored.

We know that the parameters are definitely used if passed via a command
line call to startup Tomcat. This is all well and good except that
logging off the session that started the batch script also kills the
Tomcat server!

Can anybody suggest a clever way of having this script run in
background or staying alive another way. We have looked at the option
of adding the script to Windows as a service, however even Microsoft
suggest this is risky as it involves registry edits and could corrupt
the O/S!

Cheers,
Darren
 
R

Roland de Ruiter

Hi All,

Running Apache-Tomcat 5.5.15 on a Win2K3 server using the startup.bat
and shutdown.bat scripts supplied with the ZIP distribution of Tomcat.

We are using this because it seems many of the JAVA_OPTS parameters
that can be set in the Java tab of the service control mechanism for
Tomcat are ignored.
[...]
Cheers,
Darren
Are you sure that the Java parameters are correctly entered in the Java
options field? Every parameter should appear on a new line. I.e. instead
of:
-Xmx128m -ea -Dcatalina.home=C:\Data\bin\Apache\Tomcat\5.5.12 ...
it should be like:
-Xmx128m
-ea
-Dcatalina.home=C:\Data\bin\Apache\Tomcat\5.5.12
...

Don't know about the ZIP distro's, but the exe-installer has installed
Tomcat as a Windows service, and included a service manager tray icon
which allows you to enter the Java options.
 
D

Darren.Kukulka

Thanks for the reply Roland.

We have tried entering the specific parameters into the service manager
Java Opts section for Tomcat but it refuses to start if we do so. The
equivalent command line startup is as follows;

"C:\Program Files\Java\jre1.5.0_06\bin\java"
-server -Xms1332m -Xmx1332m -XX:NewSize=400m
-XX:MaxNewSize=400m -XX:permSize=128m
-XX:MaxPermSize=128m -verbose:gc
-XX:+PrintGCTimeStamps -XX:+PrintGCDetails
-Djava.endorsed.dirs="f:\tomcat5\common\endorsed"
-classpath "F:\tomcat5\bin\bootstrap.jar"
-Dcatalina.base="f:\tomcat5"
-Dcatalina.home="F:\tomcat5"
-Djava.io.tmpdir="F:\tomcat5\temp"
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=F:\tomcat5\conf\logging.properties
-Duser.language=en
-Duser.country=GB -Dcom.sun.management.jmxremote
org.apache.catalina.startup.Bootstrap start

All of the -D options the service will accept. It will not accept any
of the others (the -server option can be implemented by changing the
JVM setting to C:\Program Files\Java\jre1.5.0_06\bin\server\jvm.dll

As far as I can see the only way to pass all these parameters is to use
the startup.bat. So now we have the problem of keeping Tomcat running
when it is started this way. As I mentioned before, if we can avoid
turning it into a service then we will.

Cheers,
Darren.
 
D

Darren.Kukulka

Roland,

Further to my last port...more testing has revealed interesting
behaviour!

If I use the JAVA_OPTS tab in the service manager for Tomcat and enter
each line one by one the service starts!

If I add the list of options from notepad all at one, even though they
appear as seperate lines once pasted in, Tomcat won't start! Very
strange!

Another interesting observation...if I pass in the ms and mx parameters
using the JAVA-OPTS entry decribed above in the service manager, the
Tomcat process appears to use the default 64MB instead of what I direct
it to use....hmmmm....any thoughts?

Cheers,
Darren.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top