Thursday, October 27, 2011

Tomcat and JBoss co-existence


Introduction

The purpose of this note is to make Tomcat and JBoss co-existence in one system.  If Tomcat has been installed in your system and you wanted to install JBoss in the same system, you may face some problems due to conflict of resources such as ports.  This note should help you solve them.

Scenario: -

Let’s say, you have installed JDK 1.4/1.5 and Tomcat 5.0/5.5 (on Port No. 8085) to deploy some applications.  Now, you want to install JBoss 3.2.6 (on Port No. 8080) to deploy some other EJB application.  You follow the normal procedure to install JBoss.  After installing, during, you may face the following error:

11:59:03,017 ERROR [Http11Protocol] Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:264)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:137)
.
.
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:407)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:311)
at org.jboss.Main.boot(Main.java:145)
at org.jboss.Main$1.run(Main.java:399)
at java.lang.Thread.run(Thread.java:534)

Solution: -

The search suggested me to change the webserver Port Number from 8080 to Something-Else (for example, 8090).  8080 is a favorite port number for a lot of different applications these days.  Please search the below mentioned files and replace 8080 to another port, say, 8090 -
'...deploy/http-invoker.sar/META-INF/jboss-service.xml' and
'...deploy/jbossweb-tomcat50.sar/server.xml'

After doing these settings restart the web server. You may still face the following console message on JBoss startup: -

11:20:00,168 INFO  [ChannelSocket] Port busy 8009 java.net.BindException:
Address already in use: JVM_Bind

This appears to be a known issue with JBoss. You can read more about this in bugs.sun.com  and bug_id=5098261

As per this information, it is not a bug.

Try the below links to ensure everything is fine:
http://localhost:8090
http://localhost:8090/jmx-console

Conclusion: - 

Tomcat and JBoss can co-exist by a simple configuration of port settings at appropriate places.