I currently have two separate instances of JBoss installed on a Linux server - v4.2.2 and v4.0.4. When I start v4.2.2, I use the command "sudo ./run.sh -b 0.0.0.0" so that it will listen on all ports. However, I only bind v4.0.4 to localhost when I start it up because I am only going to be using it for API calls. Both start fine, but when I cd to v4.0.4 bin directory and try to shut it down using the command "sudo ./shutdown -s localhost", it shuts v4.2.2 down which is a major problem because then the web site is inaccessible.
There's a number of confusing things here.
You say you use "run.sh -b 0.0.0.0"
so that it will listen on all ports - This makes it listen on all IP addresses assigned to the host, not all ports, but I think that's what you actually meant.
You also say you only bind JBoss 4.0.4 to localhost, but you don't say how you do that. Were you aware that JBoss 4.0 binds to every IP address by default, whereas 4.2 only binds to localhost by default?
Either way, I can't see how both servers could start up together, if 4.2 is listening to all IP addresses, it would clash with the other server and one of them wouldn't start up. If they're both running, then they must either be on different ports, or on different IP addresses. Which is it?
As for the 4.0 shutdown script causing 4.2 to stop, this is probably due to your mixup with IP addresses or ports.
Are you sure both of your JBoss instances start properly? Have you changed the port numbers they are using? If not, they clash, just as skaffman writes.
Consider following the 'Running multiple instances of JBoss on same server' tutorial.