Every organization have at least couple of old tomcat or java instance running but those version cannot be used for some new technology stuff like web services and you will find in situation to utilize same physical or virtual server to deploy your next state of art application which uses new version of tomcat and java.
Not sure about most of you but I found myself in above situation and decided to try out installing different version of java and tomcat on same machine.
I don't want to use java installer since it will modify my setting on windows server and I may end up fixing old app to work with new JRE.
Here is my existing configuration on windows box
and I want following to co-exists
Steps 1 & 2 are no brainer
- Copy java JRE folder(jre1.6.0_06) from different machine to target machine in x:\Program Files\Java
- Copy tomcat directory from machine where you may have already installed to target machine x:\Program Files\Apache Software Foundation\Tomcat 5.5
- Open server.xml from config folder and increment all port number by one
Tomcat 5.5 do not have catalina.bat or any other batch file where you can configure java path, latest releases of tomcat uses apache common demon called Procrun to start as service.
Execute following steps on the tomcat5.exe and tomact5W.exe in Bin folder
- Execute tomcat5.exe //IS// on command prompt - this will install windows service with name tomcat5.
- Execute tomcat5w.exe - this will launch configuration screen for tomcat5 service. Since we copied the tomcat application, most of the entries will be empty.
Fill in the following:
- Description: "Apache Tomcat 5.5.20 Server - http://tomcat.apache.org/"
- Log on if you want to start service with different credentials
- Log Path: "X:\Program Files\Apache Software Foundation\Tomcat 5.5\logs"
- Both redirect box to "Auto"
- For java JVM setting: Select new copied JVM
Update Java-class path to
"X:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar"
For Java option Add
-Dcatalina.home=X:\Program Files\Apache Software Foundation\Tomcat 5.5
-Dcatalina.base=X:\Program Files\Apache Software Foundation\Tomcat 5.5
-Djava.endorsed.dirs=X:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed
-Djava.io.tmpdir=X:\Program Files\Apache Software Foundation\Tomcat 5.5\temp
-Djava.util.logging.config.file=X:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties
Update memory pools as desired
For startup and shutdown, update class to "org.apache.catalina.startup.Bootstrap" and working Path to "x:\Program Files\Apache Software Foundation\Tomcat 5.5".
Select "JVM" in Mode option for startup and shutdown.
Update Argument with "start" and "stop" for tab startup and shutdown respectively.
If you are using Vista , make sure you start command line in Administrator mode
- At his moment you are all set , when you start the service , you may get JVM initialize error.
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
This error is cause by debug port conflict (due to other JVM running), which can be corrected by changing "address=8000" to "address=8001" in java option box.
Note: Procrun demon can be used to run any java application as windows services with no effort, Visit apache common demon called Procrun for more details.