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.
April 9th, 2008 at 5:52 am
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)
April 9th, 2008 at 9:39 am
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.
April 24th, 2008 at 3:33 am
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?
April 24th, 2008 at 11:25 am
Abhishek and Brijesh,
I have updated the post with information applicable of the current release of JBoss. Let me know if this helps.
May 2nd, 2008 at 9:12 am
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.
May 2nd, 2008 at 9:34 am
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.
July 6th, 2008 at 4:07 am
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.
July 9th, 2008 at 8:43 pm
perfect!
August 26th, 2008 at 3:36 pm
I also found an issue trying to startup two JBoss instances on the same physical server on Debian. It is related to this already know JIRA issue:
https://jira.jboss.org/jira/browse/JBAS-4155
I resolved the issue by modifying the run.conf in the jboss/bin directory:
Change 8787 to 18787
Although the above worked fine on my local windows environment!
October 10th, 2008 at 3:19 am
Hi All,
I changed all the ports as mentioned. Still I m getting the following error message. I m using JBoss 4.0. Can anybody help me on this. Its bit urgent please.
12:38:24,192 WARN [ServiceController] Problem starting service jboss.mq:service
=InvocationLayer,type=UIL2
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.(ServerSocket.java:185)
at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketF
actory.java:169)
at org.jboss.mq.il.uil2.UILServerILService.startService(UILServerILServi
ce.java:217)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.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(ServiceControl
ler.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 org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy35.start(Unknown Source)
at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
bstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.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(ServiceControl
ler.java:978)
October 20th, 2008 at 11:14 am
For automatic port binding , look at the jboss Binding Manager
http://www.jboss.org/community/docs/DOC-9376
November 5th, 2008 at 8:14 am
Re: Port renumbering for JBoss 4.2.2
Thanks exactly what I needed