You may want multiple application servers to be deployed into the same server, for example one Tomcat 6/7, one JBoss Application Server 6.x, or three JBoss Application Servers. Assuming Tomcat 6.x is running, when you start JBoss AS 6.1, you might see JBoss 8009 Port in Use BindException in the jboss boot log:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
16:15:49,918 INFO [jbossatx] ARJUNA-32017 JBossTS Transaction Service (JTA version - tag: JBOSSTS_4_14_0_Final) - JBoss Inc. 16:15:50,106 INFO [arjuna] ARJUNA-12202 registering bean jboss.jta:type=ObjectStore. 16:15:50,763 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/blackarrow/core/software/jboss/bin/native/lib 16:15:51,118 ERROR [AjpProtocol] Error initializing endpoint: java.net.BindException: Address already in use /0.0.0.0:8009 at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:1004) [:6.1.0.Final] at org.apache.coyote.ajp.AjpProtocol.init(AjpProtocol.java:169) [:6.1.0.Final] at org.apache.catalina.connector.Connector.initialize(Connector.java:1018) [:6.1.0.Final] at org.apache.catalina.core.StandardService.initialize(StandardService.java:701) [:6.1.0.Final] at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:443) [:6.1.0.Final] at org.jboss.web.tomcat.service.deployers.TomcatService.startService(TomcatService.java:359) [:6.1.0.Final] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:355) [:6.1.0.Final (Build SVNTag:JBoss_6.1.0.Final date: 20110816)] at org.jboss.system.ServiceMBeanSupport.pojoStart(ServiceMBeanSupport.java:195) [:6.1.0.Final (Build SVNTag:JBoss_6.1.0.Final date: 20110816)] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_10] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_10] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_10] at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_10] at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.1.SP1] at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.1.SP1] at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.1.SP1] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.SP2] at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.SP2] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.SP2] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.SP2] |
The error means the port 8009 has been used (Another Tomcat instance is using it), and web app inside JBoss cannot start. To fix the issue, you can change JBoss configuration to force AJP connector to used a different unused port, such as 98009.
Solution
Open $JBOSS_AS/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml
find
1 2 3 4 5 6 |
<bean class="org.jboss.services.binding.ServiceBindingMetadata"> <property name="serviceName">jboss.web:service=WebServer</property> <property name="bindingName">AjpConnector</property> <property name="port">8009</property> <property name="description">JBoss Web AJP connector socket</property> </bean> |
change AJP connector port to 8010
1 2 3 4 5 6 7 |
<bean class="org.jboss.services.binding.ServiceBindingMetadata"> <property name="serviceName">jboss.web:service=WebServer</property> <property name="bindingName">AjpConnector</property> <property name="port">8010</property> <property name="description">JBoss Web AJP connector socket</property> </bean> |
Very informative article, i am regular reader of your website. I noticed that your site is outranked by many other blogs in google’s search results. You deserve to be in top10.
Pretty! This has been an incredibly wonderful post.
Thanks for supplying this info.
Thanks for composing JBoss 8009 Port in Use BindException Fix, really like it.