Warning: many pages on this wiki imply that a servlet container must be installed before running Cocoon, this is wrong - see NoServletContainerRequired. A basic installation of Cocoon for test or development purposes can be very simple.


Installing Tomcat as Win32 service is a piece of cake - you only have to enter following commands at command line:

@SET JAVA_HOME=c:\DevTools\j2sdk1.4.2
@SET TOMCAT_HOME=C:\DevTools\jakarta-tomcat-4.1.24-LE-jdk14
@SET TOMCAT_JVM="%JAVA_HOME%\jre\bin\client\jvm.dll"
@SET TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME%\common\lib\servlet.jar
@SET TOMCAT_ENDORSED=%TOMCAT_HOME%\common\endorsed
@SET TOMCAT_LOG=%TOMCAT_HOME%\logs\stdout.log
@SET TOMCAT_ERR_LOG=%TOMCAT_HOME%\logs\stdout.log
%TOMCAT_HOME%\bin\tomcat.exe 
 -install "Tomcat" %TOMCAT_JVM% 
 -Djava.class.path=%TOMCAT_CLASSPATH% 
 -Djava.endorsed.dirs=%TOMCAT_ENDORSED% 
 -Dcatalina.home=%TOMCAT_HOME% 
 -start org.apache.catalina.startup.BootstrapService 
 -params start 
 -stop org.apache.catalina.startup.BootstrapService 
 -params stop -out %TOMCAT_LOG% 
 -err %TOMCAT_ERR_LOG%

Note: the last command has to be entered in one single line!

and this is how you uninstall your service

tomcat.exe -uninstall Tomcat

by Leszek Gawron, added by ReinhardPoetz


To give the JVM more Memory add the the following to the code above:

...
@SET CATALINA_OPTS=-server -Xms64m -Xmx512m
%TOMCAT_HOME%\bin\tomcat.exe 
 -install "Tomcat" %TOMCAT_JVM% 
 -Djava.class.path=%TOMCAT_CLASSPATH% 
 -Djava.endorsed.dirs=%TOMCAT_ENDORSED% 
 -Dcatalina.home=%TOMCAT_HOME% 
 %CATALINA_OPTS%
...

by Martin Geissler


Note: Using org.apache.catalina.startup.BootstrapService breaks the "swallowOutput" context directive. Using org.apache.catalina.startup.BootstrapService makes it work back again...

Don't know why... just facts.

This causes "swallowOutput" to work again.

  • No labels