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
o change 8080 to 18080
* default/conf/jboss-service.xml
o change 1099 to 11099
o change 1098 to 11098
o change 4445 to 14445
o change 4444 to 14444
* default/conf/jboss-minimal.xml
o change 1099 to 11099
o change 1098 to 11098
* default/deploy/jms/uil2-service.xml
o 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
o change 8080 to 18080
o change 8443 to 18443
o change 8009 to 18009
* deploy/http-invoker.sar/META-INF/jboss-service.xml
o change 8080 to 18080
* deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml
o change 8080 to 18080
o change 8443 to 18443
* deploy/ejb3.deployer/META-INF/jboss-service.xml
o change 3873 to 13873
* deploy/jms/uil2-service.xml
o change 8093 to 18093
* conf/jboss-service.xml
o change 8083 to 18083
* conf/jboss-minimal.xml
o change 1099 to 11099
o change 1098 to 11098
* conf/jboss-service.xml
o change 1099 to 11099
o change 1098 to 11098
o change 4444 to 14444
o change 4445 to 14445
o change 4446 to 14446
There can be many entries of these port numbers in these files. Make sure you change all of them.
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)
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.
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?
Abhishek and Brijesh,
I have updated the post with information applicable of the current release of JBoss. Let me know if this helps.
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.
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.
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.
perfect!
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!
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)
For automatic port binding , look at the jboss Binding Manager
http://www.jboss.org/community/docs/DOC-9376
Re: Port renumbering for JBoss 4.2.2
Thanks exactly what I needed
Hi ,
i did all the things mentioned by you. if i try to connect from a client in the new provider url, error message is given as Server could not be connected. what to do for this
Santhosh,
Looks like the second instance didn’t startup correctly. Take a look at the logs.
Try to start only the second instance and see if you can connect.
No: Something is messed up when you updated configuration or some other software is running on that port.
Yes: start the first instance now. If you can’t connect to first instance now, probably a service in both instance is trying to use the same port
Thanks for writing this at one place!! It was helpful.
Don’t do this. Use the ServiceBindingManager like Sebastien mentioned above. http://www.jboss.org/community/docs/DOC-9376
Dear All.
Can anyone give me a document for the step by step detiled description for setting up cluster in jboss
is this setting applicable for jboss 4.2.3 GA
Aboo,
These steps were tried with JBoss 4.2.2 GA. I would guess it should be applicable for JBoss 4.2.3 GA as well, but haven’t tried that.
Hi,
I have started 2 jboss instance on ports 8080 and 9080.
I am using apache http server to connect to these instances.
The entry in workers.properties in apache is same for both these instance, then how does apache send request to these instances.
when i start the 2nd instance, my application crashes saying Your Application session has expired or an unexpected error has occured!
any idea what may be wrong???
People, you need to take a look at JBOSSAS\docs\examples\binding-manager\sample-bindings.xml this should take all the port bingings into one file that you can change makes life a lot easier
Thanks so much . It really helped.
Thanks Mano. I appreciate your work. I’ve used your solution many times and it is correct for the mentioned Jboss version.
Now I am using jboss-5.0.1.GA. Can you tell which ports we’ve to change in this version to run multiple instances on same machine?
Guys,
This is the best way to run multiple instances in one machine:
in [/docs/examples/binding-manager] there is a file “sample-bindings.xml” that has the instances configuration. inside the file you’ll find , , … ech represents a configuration for one instance.
in your server.xml change the port number where your instance will run on:
in jboss-service.xml of your instance choose the ServerName you defined in “sample-bindings.xml”, example below.
ports-01
${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml
org.jboss.services.binding.XMLServicesStoreFactory
finally start each instance, in unix, you do “run.sh -c default”
thank you
Thanks Mano. It worked well for JBoss 4.2.3.GA