Release Your Port



Release Your Port

Lets assume you have developed webapplication  using  Eclipse, and you have configured tomcat server,running at port number 2011.
When you run your application through Eclipse,and lets say in the middle of execution,your Eclipse IDE got hanged and its not responding.All the option you will have is to end the program and relaunch the IDE.
But,Since Tomcat was already started and it was not closed before closing the IDE,it would be still in running mode using port:2011.
The next time you relaunch the IDE,and try to execute the Application,You will get the below error.
 java.net.BindException:Address already in use:JVM_Bind<null>:2011
The programmer is thus blocked to use tomcat server.If you have installed Tomcat using installers,you will not get any facility to stop the server.Further,you cannot stop the server from services.
Solution:
When a tomcat server is running,the Operating system executes it as a Process at some port number(2011).Each process is identified by a process Id.We need to find the process id and then kill the process,so that your tomcat server can be stopped and you can start them again using Eclipse.
Steps:
1.Use netstat command to find out the process id of Tomcat which is running at port no 2011
C:\>netstat -o -a

Look into the screen,the tomcat is running at 2011 and its process id =7328
2.Kill this process using taskkill command.
taskkill /pid  73238 /f

3.Re-run the netstat command as given in step 1.You will not find anything running on port 2011.That means the service or process is killed.
Now you can again start the server using Eclipse.
Note: This process can be used to kill any process,even oracle or etc…
Hope you found this article useful.Happy Killing Processes

Post a Comment

Thank You

Previous Post Next Post