Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to open debugger port in IntelliJ IDEA

I have a problem that I can not set up my application in debug mode with IntelliJ IDE, but run mode is OK.

My OS is Windows 7, IDE is IntelliJ IDEA, web container is Tomcat 6. I have tried for a long time, changed the HTTP port and the JMX port, but it did not work.

When I set up the app in debug mode with IntelliJ, it failed and the event log is:

16:05:35 Error running tomcat: Unable to open debugger port : java.net.BindException "Address already in use: JVM_Bind".

like image 883
feng smith Avatar asked Oct 09 '14 08:10

feng smith


1 Answers

the key to the issue is in debugger port. I was having the same problem, I was killing every process listening on port 8081 (my http port), 1099 (JMX port), tomcat shutdown port, every java.exe, and still nothing.

The thing is this debugger port is different. If you run the application, it will go through the port you have Tomcat configured for, 8080, 8081 or whatever. But if you run it in Debug mode, it goes through a different port.

If you go edit your Tomcat configuration from IntelliJ, the last tab is Startup/Connection. Here go see the configuration for Debug mode, and you'll see its port. Mine was 50473. I changed it to 50472, and everything started working again.

like image 79
T.M. Avatar answered Sep 25 '22 21:09

T.M.