problem with co-existance of Tomcat and JBoss.

I had installed JDK 1.5 and Tomcat 5.5 to deploy some applications, in my machine. Now, I want to install JBoss 3.2.6 to deploy EJB application. But, it is showing 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.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:1429)

at org.jboss.web.tomcat.tc5.StandardService.initialize(StandardService.java:688)

at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2384)

at org.apache.catalina.startup.Catalina.load(Catalina.java:507)

at org.apache.catalina.startup.Catalina.start(Catalina.java:548)

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:324)

at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)

at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:149)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.web.tomcat.tc5.Tomcat5.startService(Tomcat5.java:337)

at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)

at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)

at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)

at $Proxy18.start(Unknown Source)

at org.jboss.system.ServiceController.start(ServiceController.java:414)

at org.jboss.system.ServiceController.start(ServiceController.java:436)

at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)

at $Proxy4.start(Unknown Source)

at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)

at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)

at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)

at $Proxy8.deploy(Unknown Source)

at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)

at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:478)

at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)

at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)

at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)

at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)

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:324)

at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)

at $Proxy0.start(Unknown Source)

at org.jboss.system.ServiceController.start(ServiceController.java:414)

at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)

at $Proxy4.start(Unknown Source)

at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)

at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:588)

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:324)

at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)

at $Proxy5.deploy(Unknown Source)

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)

I thought, Tomcat and JBoss, both are using the same JVM port numbers. Then, I have modified the following files' port numbers :

C:\jboss-3.2.6\server\default\conf\jboss-service.xml

C:\jboss-3.2.6\server\all\conf\jboss-service.xml

C:\jboss-3.2.6\server\minimal\conf\jboss-service.xml

I have modified the port information from 1099 to 11099 and 1098 to 11098.

But, still I am facing the problem.

[8916 byte] By [Mr.Rama] at [2007-10-3 2:32:26]
# 1
java.net.BindException: Address already in use: JVM_Bind:8080
CeciNEstPasUnProgrammeura at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 2
To change the prot used by JBOSS, I believe you also need to edit the server.xml for the Tomcat service under JBOSS. If I'm not mistaken, the last time I looked, JBOSS was still using its own Tomcat Web container internally.
karma-9a at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 3

Exactly, JBoss use its own internal Tomcat. So you don't use Tomcat and JBoss, but only JBoss.

Find the directory in JBoss where is tomcat and place your web application file.

In my case:

The JSP file in:

C:\Programmi\JBoss\jboss-4.0.2\server\default\deploy\jbossweb-tomcat55.sar\ROOT.war\webapps\myproject

The JavaBeans in:

C:\Programmi\JBoss\jboss-4.0.2\server\default\deploy\

jbossweb-tomcat55.sar\ROOT.war\WEB-INF\classes

and take a copy also in:

webapps\myproject\WEB-INF\classes

bye

UBERTI84a at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 4

Or, if the tomcat already existed, and JBoss came later, maybe you can configure JBoss to use the existing Tomcat, rather than the embedded one. I don't know if JBoss provides a mechanism for this, but they should. Hell, even Netbeans lets you use an existing Tomcat rather than the embedded one that comes with it, so if they can doit, I would assume that JBoss would also let you do it.

masijade.a at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 5
Previously, Tomcat is installed with 8085 port in my system.Message was edited by: Mr.Ram
Mr.Rama at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 6

> Or, if the tomcat already existed, and JBoss came

> later, maybe you can configure JBoss to use the

> existing Tomcat, rather than the embedded one. I

> don't know if JBoss provides a mechanism for this,

> but they should. Hell, even Netbeans lets you use an

> existing Tomcat rather than the embedded one that

> comes with it, so if they can doit, I would assume

> that JBoss would also let you do it.

No, actually you can't. To be specific, there is a service called something like tomcat-5.5.sar. This SAR (Service ARchive) contains the Catalina engine from Tomcat 5.5, but not the actual Tomcat server itself. JBoss effectively does the same thing as Tomcat when executing code in the Web Container, because it's just calling the Catalina functions. It can't stand alone though, because the bootstrap code is missing, and you can't simply point JBoss at a different Tomcat installation because a SAR is a slightly different representation of the same code. You can, however, take the WAR from an existing Tomcat installation and hot-deploy it to JBoss provided there's no version issues.

To address the OP, you would have to change the port number that JBoss uses for the Web Container by editing the jboss-service.xml file in the tomcat-5.5.sar directory.

Brian

brian@cubik.caa at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 7

I got the following information through the link http://www.newspiritcompany.com/ejb01.htm :-

Changing the Port Number from 8080 to Something-Else (for example, 8090)

8080 is a favorite port number for a lot of different applications these days,

I want my application-server to start cleanly, so I rarely use the default port 8080.

With JBOSS, to change the port number, I normally search the JBOSS_HOME/server/default using

'grep -R 8080 *' or similar command. But for those who don't want to do that, you can modify,

'...deploy/http-invoker.sar/META-INF/jboss-service.xml' and

'...deploy/jbossweb-tomcat50.sar/server.xml' or whatever files lock onto port 8080.

And if everything works properly, you should see these two web-pages at for example:

http://localhost:8090

http://localhost:8090/jmx-console

I have done the above steps.

But, still I am facing the following message on JBoss startup :-

11:20:00,168 INFO [ChannelSocket] Port busy 8009 java.net.BindException:

Address already in use: JVM_Bind

I have gone through the following link.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5098261

As per this information, it is not a bug.

-

-

Conclusion :- If we want to install Tomcat and JBoss in one system,

we have to change the Port Number of JBoss from 8080 to 8090 in the following files,

'...deploy/http-invoker.sar/META-INF/jboss-service.xml' and

'...deploy/jbossweb-tomcat50.sar/server.xml'.

Mr.Rama at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 8

i just met the same problem,and solved it.

i just did it as follow:

1,find a xml file named server.xml. you can find it in your JBOSS_HOME\server\default\deploy\jbossweb-tomcat55.sar\

2,edit it

<Connector port="8080"[/b[](use 8090 or others instead of 8080) address="${jboss.bind.address}"

maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"

emptySessionPath="true"

enableLookups="false" redirectPort="8443" acceptCount="100"

connectionTimeout="20000" disableUploadTimeout="true"/>

3,save and restar your jboss with default moudle

my english is not very good,so......:> hope you can solve it

Message was edited by:

no3no4lwj

no3no4lwja at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 9

i just met the same problem,and solved it.

i just did it as follow:

1,find a xml file named server.xml. you can find it in your JBOSS_HOME\server\default\deploy\jbossweb-tomcat55.sar\

2,edit it

<Connector port="8080"[/b](use 8090 or others instead of 8080) address="${jboss.bind.address}"

maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"

emptySessionPath="true"

enableLookups="false" redirectPort="8443" acceptCount="100"

connectionTimeout="20000" disableUploadTimeout="true"/>

3,save and restar your jboss with default moudle

my english is not very good,so......:> hope you can solve it

Message was edited by:

no3no4lwj

no3no4lwja at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 10

The error u mentioned is bcoz there is already one instance of JVM service running on the same port.

What i can suggest is u can change the Port of Tomcat(<CATALINA_HOME>/conf/service.xml) to 9090 or anything else.

JBoss also ships with embedded web container(either Tomcat or Jetty). so u can just use the embedded Tomcat or else u can disable the embedded Tomcat by commentiing <Service> tag in service.xml (<JBOSS_HOME>/catalina/conf/service.xml). This will allow u to run JBOSS without embedded web container and then u can freely use the external web container. This solution helped me.

Plz Try this out.

d.suhasa at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 11
Mate, if you're using jboss just uninstall tomcat... you don't NEED it, and it's causing grief... you can allways install it again later if you need it for something else.corlettk: dislexic fingers again.
corlettka at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...
# 12
Hallo, I am using embedded tomcat in Jboss. Even i am getting the same problem. The problem is, Tomcat home page is displayed when i start jboss server. Address Already in use : JVM_Bind. Waiting for your reply MMMM
mars@sayampua at 2007-7-14 19:31:24 > top of Java-index,Java Essentials,New To Java...