Solving Port Conflicts in Windows

      Comments Off on Solving Port Conflicts in Windows

Suppose that you start a server application like JBoss and get an error message like this one:

14:13:51,561 ERROR [AbstractKernelController] Error installing to Start: name=jboss.remoting:protocol=rmi,service=JMXConnectorServer state=Create mode=Manual requiredState=Installed
java.rmi.server.ExportException: Port already in use: 1090; nested exception is:
java.net.BindException: Address already in use: JVM_Bind

“Wait a minute,” you say, “That port should be free! Who’s using it?”

To find the answer, open a command window and type:

netstat -ab | findstr 1090

substituting the actual port number for “1090”. Under Windows 7 you will need to open the command window as an Administrator.

The netstat command will take a long time to run, but eventually it will give you the name and PID of the offending process. At that point you can decide whether to kill the offending process or make your application use a different port.