• SocialTwist Tell-a-Friend
  • View Aishwarya Mishra's profile on LinkedIn

JVM_Bind Address already in use – What to do?

[I have added an update at the end of this post courtsey Vishwas :-)]

Normally, I come across this error when I am working with app servers and especially when I am starting the server – that is when most of the ports are reserved for listening. Almost all of us who know simple english would realize that there is some resource that the application is trying to use but which is already in use by some other application or process. However, what is worth knowing, is how to resolve this issue, esp in Windows!

Simply speaking, we need to identify the port number over which the two processes are fighting and then check if the current process that is holding the port number ransom can be killed. If the holding process is dispensable then kill it and restart the new process else change the settings of the new process (if possible) to use another port number. Killing is not the difficult part. Identifying the process which is holding the port number is the interesting part.

UNIX/Linux offers us the lsof command and one can use it in the following syntax to get the process id.

lsof -i:<port-number>

In windows, unless you have installed a linux/unix emulator, you can follow a two step process.

Do a “netstat -o > <some-text-file>” to get all the ports along with their owning process id.

After that search for the port number that you want. Once you get the process id from the netstat output, find more details (task manager is the simplest tool for this). Kill it :-).

Vishwas has suggested two tools which can save us this rigmarole. Current Ports (from NirSoft) is a very nifty tool which allows us to view a lot of information related to a particular port or a process – I would vouch for it for its simplicity. The other tool is Process Explorer. It did display a lot of information but I could not discover how to check the port number. Current Ports solves our problems much better.

3 Responses

  1. Talk abt backward integration…the era belongs to QA expecting this sorta thing from developers themselves.
    Hope u r not alone here đŸ™‚

  2. Thanks digit.

  3. It’s going to be end of mine day, but before end I am reading this enormous article to increase my know-how.

Leave a comment