I want to run JBoss 4.2.3 and JBoss 5.1 on the same server, but not simultaneously. I just need to be able to switch back and forth between the two for testing, so I don't need to change ports or anything like that. My problem is the JBOSS_HOME environment variable. When I set up a /soft/JBoss-4.2.3.GA directory and a /soft/JBoss-5.1.0.GA directory I can run the respective bin run.sh commands, however, both try to use the $JBOSS_HOME and $PATH environment variables which are set to the first installation (JBoss-4.2.3). So, how can I set separate environment variables? Or tell my new JBoss 5.1 installation to use another environment variable for JBOSS_HOME? How would I go about getting these two running together? Thanks!
A fast solution would be to set the $JBOSS_HOME and $PATH variable within the run.sh to the appropiate directory of each JBoss instance.
The best solution in this case is use virtual ip interface, you will keep the default ports and will just change de IP address.
to start jboss doing binding to another IP just add this parameter in the run.sh (or persistent in run.conf):
sh run.sh -b 192.168.0.1
and the other instance just start point to another IP
sh run.sh -b 192.168.0.2
I had a similar problem recently and my workaround is a pair of wrapper scripts for each version of JBoss AS.