Running multiple JBoss instances on the same machine

Did you ever had the requirement to run multiple JBoss instances on the same machine? Its a trivial task if you exactly know the parameters to be tweaked.

Carryout the following steps with your second instance (This is applicable for JBoss 4.0.3):

  • default/deploy/jbossweb-tomcat55.sar/server.xml
    • change 8080 to 18080
  • default/conf/jboss-service.xml
    • change 1099 to 11099
    • change 1098 to 11098
    • change 4445 to 14445
    • change 4444 to 14444
  • default/conf/jboss-minimal.xml
    • change 1099 to 11099
    • change 1098 to 11098
  • default/deploy/jms/uil2-service.xml
    • change 8093 to 18093

Voila! You’re done!!

Update (04/24/2008):

Many of you requested steps for current release of JBoss 4.2.2 GA, here it goes:

  • deploy/jboss-web.deployer/server.xml
    • change 8080 to 18080
    • change 8443 to 18443
    • change 8009 to 18009
  • deploy/http-invoker.sar/META-INF/jboss-service.xml
    • change 8080 to 18080
  • deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml
    • change 8080 to 18080
    • change 8443 to 18443
  • deploy/ejb3.deployer/META-INF/jboss-service.xml
    • change 3873 to 13873
  • deploy/jms/uil2-service.xml
    • change 8093 to 18093
  • conf/jboss-service.xml
    • change 8083 to 18083
  • conf/jboss-minimal.xml
    • change 1099 to 11099
    • change 1098 to 11098
  • conf/jboss-service.xml
    • change 1099 to 11099
    • change 1098 to 11098
    • change 4444 to 14444
    • change 4445 to 14445
    • change 4446 to 14446

There can be many entries of these port numbers in these files. Make sure you change all of them.

8 Responses to “Running multiple JBoss instances on the same machine”

  1. Brijesh Says:

    When running two jboss server on One Machine Got
    the error message
    15:20:40,500 ERROR [SocketServerInvoker] Error starting ServerSocket. Bind port: 9873, bind address
    : /10.15.1.130
    15:20:40,546 ERROR [Connector] Error starting connector.
    java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)

  2. Mano Says:

    Brijesh,

    What version of jBoss are you using? This post is applicable for v 4.0.3, but should be similar for other versions also. A simple technique to fix your issue is to search for 9873 in all configuration files of jBoss and replace them 19873 in your second instance.

  3. Abhishek Says:

    Hi Manohar,

    I too am running in a similar problem. I am using JBoss 4.0.5GA and error i got when running two JBoss instances on the same machine is:
    :11:20,656 WARN [ServiceController] Problem starting service jboss:service=WebService
    va.lang.Exception: Port 8083 already in use.
    at org.jboss.web.WebServer.start(WebServer.java:235)
    at org.jboss.web.WebService.startService(WebService.java:337)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at org.jboss.system.ServiceController.start(ServiceController.java:435)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

    Can i get a solution for this?

  4. Mano Says:

    Abhishek and Brijesh,

    I have updated the post with information applicable of the current release of JBoss. Let me know if this helps.

  5. Andrew Says:

    Hi. This is slightly off-topic, but have you experienced any session mix-up problems when running multiple JBOSS instances on the same machine? We are running 4.0.5.GA, binding each server to a specific IP, and have a custom application running. We are experiencing occasion session data mix-up between the 2 instances.

  6. Mano Says:

    I have not come across this situation. I suggest you check your coding for any possible misuse of static variables, custom threading or caching. Also, try tools such as LiveHTTPHeaders that will allow you to monitor cookies and other header info.

  7. Eugene Reynes Says:

    I have managed to make the two instances work on JBoss 4.2.2 using two separate instance of JBoss. Two sepatae apps running simultaneously both on Ports 8888 and 8889. I have only modified the JBoss Instance for the Second App and also modified jboss-service.xml change Port 25000 to 25001, everything worked fine.

    Thanks for the help.

  8. Humberto Says:

    perfect!

Leave a Reply

Spam protection by WP Captcha-Free