Apache Tomcat startup issue in Windows

Discussion in 'Java' started by Darren.Kukulka@connaught.plc.uk, Apr 26, 2006.

  1. Guest

    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
    , Apr 26, 2006
    #1
    1. Advertising

  2. wrote:
    > 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.
    --
    Regards,

    Roland
    Roland de Ruiter, Apr 26, 2006
    #2
    1. Advertising

  3. Guest

    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.
    , Apr 27, 2006
    #3
  4. Guest

    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.
    , Apr 27, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. perlrulez
    Replies:
    0
    Views:
    348
    perlrulez
    Feb 6, 2004
  2. perlrulez
    Replies:
    2
    Views:
    436
  3. Christos Gravvanis
    Replies:
    0
    Views:
    2,044
    Christos Gravvanis
    Jul 7, 2004
  4. twins
    Replies:
    1
    Views:
    5,856
  5. Marcin Cenkier
    Replies:
    1
    Views:
    5,412
    Marcin Cenkier
    Apr 12, 2006
Loading...

Share This Page