Tuesday 27 August 2013

Java.net.BindException: Address already in use: JVM_Bind:8080 Solution


This exception is self explanatory, its saying that a Java application is trying to connect on port 8080 but that port is already used by some other process and JVM Bind to that particular port, here its 8080, is failed. Now to fix this error you need to find out which process is listening of port 8080, we will how to find a process which is listening on a particular port in windows and then how to kill that process to make our port free to use.


Common Scenario when you see "Address already in use: JVM_Bind"
1. While doing Java remote debugging in Eclipse and when Eclipse tries to connect your remote java application on a particular port and that port is not free.
2. Starting tomcat when earlier instance of tomcat is already running and bonded to 8080 port. It will fail with SEVERE: Error initializing endpoint java.net.BindException: Address already in use: JVM_Bind:8080



Find and listening port


1. Go to run
2. Type cmd
3. Write this command

netstat -ano | find "8080"


You will get a list of process listening to that port





4. Kill all the task 


write this command 


taskkill /F /PID 7820



7820 -- This is the Id which you can see in the last column





No comments:

Post a Comment

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...