Is it possible to install multiple instances of Tomcat on one server to create a development, test and production version?
Created May 14, 2012
JIA Java Italian Association
Additional info:You need to be sure to change every port that Tomcat uses.
I am trying to create a seperate development, test and production environment on one windows NT-server. To ensure that each environment is completely seperated from all others, I tried installing 3 seperate versions of Jakarta-Tomcat making sure to assign different ports to each in the seperate server.xml files.
When one environment is up and running, starting a new environment will result in the following message in the "tomcat command box":
FATAL: java.net.BindExeption: Address in use: JVM_Bind
java.net.BindExeption: Address in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind<Native Method>
at java.net.PlainSocketImpl.bind<PlainSocketImpl.java:452>
at java.net.ServerSocket.<init><ServerSocket.java:170>
at java.net.ServerSocket.<init><ServerSocket.java:121>
The default installation, for example, uses 3 different ports:
- one for the http connector (default 8080)
- one for the ajp connector (8009)
- one for the shutdown port (8005)
That error message is displayed when you haven't changed all ports, and two, or more, instances are trying to access to the same port.
Please check the config files again.
By the way, with Tomcat 4.x.x, you don't need to install 3 times Tomcat. You can install the codebase once, and then having 3 difference indipendent instances by using the CATALINA_BASE ebvironment variable. Check out (4) Advanced Configuration - Multiple Tomcat 4 Instances from the Install and Run document.