wood burning stoves*
The moose likes JBoss/WildFly and the fly likes Port Already in Use Error On Server Startup : Process gets Started twice in same Port at Same time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Port Already in Use Error On Server Startup : Process gets Started twice in same Port at Same time" Watch "Port Already in Use Error On Server Startup : Process gets Started twice in same Port at Same time" New topic
Author

Port Already in Use Error On Server Startup : Process gets Started twice in same Port at Same time

Ramesh Jothimani
Ranch Hand

Joined: May 05, 2011
Posts: 70

When I start my JBoss server , I am always getting Port already in use error. I tried changing Port nos in server.xml in JBoss but what ever port number I mention in server.xml , the same error "Port already in use :: <Port No> " is being displayed in my eclipse console. Using TCP viewer I found that the same process gets run twice in same port on server startup but one for V4 & one for V6 .Mine is 64 Bit Operating System - WIndows 7.

Please help me to solve this problem.

Thanks !
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

What is V4 and V6?

Could you post a screen shot of TCP View that shows which ports and processes you are having the issue with? Posting the exact text form the console log would also help.

Also, I assume that if you don't use Eclipse, and start JBoss AS manually, then you don't run into any problems? (Eclipse is notorious for messing things up in it misguided attempts to be helpful, which is why I never use it for any tasks beyond editing text files.)

JBoss In Action
Ramesh Jothimani
Ranch Hand

Joined: May 05, 2011
Posts: 70

Thanks for the reply !

I guess V4 & V6 refer to IPV4 and IPV6 . I have attached the screenshot of TCP Viewer showing the processes running on same ports. I am using eclipse and the error displayed in the console is as follows,

22:38:32,688 ERROR [Http11BaseProtocol] Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8081
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:297)
at org.apache.coyote.http11.Http11BaseProtocol.init(Http11BaseProtocol.java:138)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1016)
at org.jboss.web.tomcat.tc5.StandardService.initialize(StandardService.java:688)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:791)
at org.apache.catalina.startup.Catalina.load(Catalina.java:503)
at org.apache.catalina.startup.Catalina.start(Catalina.java:543)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25



[Thumbnail for Port.jpg]

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10068
    
163

Which exact version of JBoss AS? And does it work outside of the IDE, if you start from the command prompt?

[My Blog] [JavaRanch Journal]
Ramesh Jothimani
Ranch Hand

Joined: May 05, 2011
Posts: 70

I am using jboss- version 4.0.5 and it works fine in other PC which is running 32 bit Windows XP .
Ramesh Jothimani
Ranch Hand

Joined: May 05, 2011
Posts: 70

I found that there are two Port Nos in server.xml (deploy\jbossweb-tomcat55.sar directory) , connector port & redirect port. Both Port Nos has been mentioned as same earlier & I have made it different . My JBoss is getting started properly , now.

<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="false"
protocol="HTTP/1.1"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
/>


Thanks !
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10068
    
163

I wouldn't expect the redirect port value to play a role while binding the ports. The redirect port is there to redirect secure traffic from the non secure port (8080). It's a bit surprising that this was causing an issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Port Already in Use Error On Server Startup : Process gets Started twice in same Port at Same time