Error "xxxx: java.net.BindException: Address already in use".

Error "xxxx: java.net.BindException: Address already in use".

book

Article ID: KB0093397

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Service Grid -
TIBCO ActiveMatrix BusinessWorks Service Engine -
TIBCO BPM Enterprise (formerly TIBCO ActiveMatrix BPM) -

Description

Description:
Error "xxxx: java.net.BindException: Address already in use" seen when starting up my Host/Node/HTTPConnector/Applicaiton process.

Issue/Introduction

Error "xxxx: java.net.BindException: Address already in use".

Resolution

This indicate a port conflict. The port configured for Host/Node/HTTPConnector/Applicaiton is already being used by some other process.

There are two possible resolutions for this issue.

1). Change the configured port to some other free port and  try to start the Host/Node/HTTP Connector/Application.

2). Identify the process which is occupying the port and stop that application/process and then try to start Host/Node/HTTPConnector/Applicaiton. To identify which process is using the port, contact your System Administrator for assistance.

The following are a few useful commands for reference. 

From the error stack trace identify the port which is already in use, error stack trace will have the port number. Ex.

"service:jmx:jmxmp://hostname:36013": java.net.BindException: Address already in use"

 "Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind:10866"

Windows Machine (M/C):
Open a command prompt and execute "netstat -anb |  findstr "<<port>>"", from the output of this command find out the process associated to the port in question.

From task manager kill the process or stop the application/executable gracefully.

Linux M/C:
From a shell prompt: "netstat -anp | grep <<port>>" or "lsof -i:<<port>>"

From the output find out the process associated to the port in question. Stop or kill the process using pid, "kill -9 <<pid>>>".

Solaris:
For Solaris you need to execute the following command as root from a shell prompt.
ps -ef| awk '{print $2}'| xargs -I '{}' sh -c 'echo examining process {}; pfiles {}| grep <<port>>'

From the output of these commands you can find out the process associated with the port in question. Stop or kill the process using pid, "kill -9 <<pid>>".