JBoss application server tutorials

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

Solving java.net.BindException: Address already in use: JVM_Bind

 

Have you got "java.net.BindException: Address already in use: JVM_Bind" when you start JBoss ?  Here's how to solve it.

 

The most likely option is that you have still one instance of JBoss running, maybe because of an unclean shutdown. Verify from the Windows Task Manager or (Unix User) with a ps -ef that you don't have any jboss server running.

In the unfortunate circumstance that jboss is not active then there's a process which has stolen some of JBoss default ports. In the following table you can find a list of JBoss default ports for some common services:

Port

Type

Service Descriptor

Service Name

Attribute Name

 

1098

TCP

conf/jboss-service.xml

jboss:service=Naming

RmiPort

1099

TCP

conf/jboss-service.xml

jboss:service=Naming

Port

3873

TCP

deploy/ejb3.deployer/META-INF/jboss-service.xml

jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3

InvokerLocator

4444

TCP

conf/jboss-service.xml

jboss:service=invoker,type=jrmp (legacy 4.0.x invoker)

RMIObjectPort

4445

TCP

conf/jboss-service.xml

jboss:service=invoker,type=pooled (legacy 4.0.x invoker)

ServerBindPort

4446

TCP

conf/jboss-service.xml

jboss.remoting:service=Connector,transport=socket (EJB2 beans in AS/EAP 4.2+)

serverBindPort on Configuration

8009

TCP

deploy/jbossweb-tomcat41.sar/META-INF/jboss-service.xml

jboss.web:service=WebServer

port on AJP Connector

8080

TCP

deploy/jbossweb-tomcat41.sar/META-INF/jboss-service.xml

jboss.web:service=WebServer

port on HTTP Connector

8083

TCP

conf/jboss-service.xml

jboss:service=WebService

Port

8090

TCP

deploy/jms/oil-service.xml

jboss.mq:service=InvocationLayer,type=OIL

ServerBindPort

8092

TCP

deploy/jms/oil2-service.xml

jboss.mq:service=InvocationLayer,type=OIL2

ServerBindPort

8093

TCP

deploy/jms/uil2-service.xml

jboss.mq:service=InvocationLayer,type=UIL2

ServerBindPort

0(a)

TCP

deploy/jms/rmi-il-service.xml

jboss.mq:service=InvocationLayer,type=RMI

NONE

0(b)

UDP

deploy/snmp-adaptor.sar/META-INF/jboss-service.xml

jboss.jmx:name=SnmpAgent,service=snmp,type=adaptor

One frequent cause is MS Office or MS OfficeCommunicator that sometimes engage port 1098 and 1099.
If you don't want to shut down these tools then your only option is using a different bind address

run -b xx.xx.xx.xx


Where xx.xx.xx.xx is JBoss bind address.
If the cause of problem cannot still cannot be found you have to resort to a few admin tricks.

Windows users:

1. In MS-DOS, send command "netstat -ao". You can get network information for all processes.
2. Find out the one using port 1098, get the PID.
3. Find out the process with the PID you just got from windows task manager and shut it down. (By default the Task Manager doesn't show the PID. You have to add it from the menu View | Select columns)
4. Restart JBoss.
5. Restart the application you've just shutdown.

Unix users:

Most Unix systems have the built-in fuser command that returns the process which is engaging a port :

fuser -v -n (tcp | udp) <port#>

java.net.BindException: Cannot assign requested address:

If you don't have any other service running on that port, it's most likely that you have an issue with your server configuration. Verify in your application server logs that you don't have the message "java.net.BindException: Cannot assign requested address". If you can find this error message, it means that your server configuration cannot boot the server with the requested IP address. Things to check:

1) Check the specific service configuration: for example if the issue is on the Web server service, check in your server.xml:

<Connector protocol="HTTP/1.1" port="${jboss.web.http.port}" address="${jboss.bind.address}"
 redirectPort="${jboss.web.https.port}" />

There you have to check that the jboss.bind.address is correct

2) Also verify that, if you are overriding the server bind address, with the -b option. Most likely you are trying to bind to a wrong server name/address.

See also this tutorial for more information about JBoss port configuration.<

Solving java.net.BindException: Address already in use: JVM_Bind
Francesco Google+
Top Programming Sites
You are here Home