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. The Ports number used by JBoss / WildFly are quite different, depending on the version of the application server you are using. The following section will list all the ports open by each application server version:

Ports used by WildFly 8

Port

Description

8080

HTTP Service

9080

Management Service

8009

AJP protocol (Not active by default)

Ports used by JBoss AS 7 / EAP 6

Port

Description

8080

HTTP Service

9080

Management Service (Admin Console)

9999

Management Service (CLI)

4447

Remoting

5445

Messaging ( Full configurations)

8009

AJP protocol (Not active by default)

Ports used by JBoss AS 5

Port

Description

1098,1099

HTTP Naming

3873

DefaultEjb3Connector

4444,4445,4446

EJB RMIObjectPort 

8080

HTTP Service

8009

AJP protocol

8009

AJP protocol (Not active by default)

8083

Web services

8090,8092,8093

JMS ServerBindPort

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.<
Advertisement

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