Unable to open debugger port in IntelliJ IDEA

2020-05-13 07:04发布

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".

25条回答
We Are One
2楼-- · 2020-05-13 07:26

There are multiple solution for the same.

  1. Either we may close the IDE (e.g. IntellJ)
  2. Find t IND00123:bin devbratanand$ lsof -i:30303 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME idea 437 devbratanand 56u IPv4 0xb2720e580a7d6483 0t0 TCP 10.17.130.41:55222->vmqp-cms-pan-app1.emea.akqa.local:30303 (ESTABLISHED) IND00123:bin devbratanand$ kill -9 437
查看更多
三岁会撩人
3楼-- · 2020-05-13 07:28

The only thing that worked for me is to go to Task Manager on Windows, and end all the Java processes that is running by right click -> end Task.

查看更多
叛逆
4楼-- · 2020-05-13 07:30

I have the same issue,because my computer's DNS miss 127.0.0.1 localhost. When I add 127.0.0.1 localhost to my host file,it become ok.

查看更多
走好不送
5楼-- · 2020-05-13 07:32

For me, IntelliJ Event Log (right bottom corner) had below logs:

Error running EntitmentTooling-Debug: Cannot run program "/path-to/apache-tomcat-8.5.15/bin/catalina.sh" (in directory "path-to/apache-tomcat-8.5.15/bin"): error=13, Permission denied

Error running EntitmentTooling-Debug: Unable to open debugger port (127.0.0.1:58804): java.net.SocketException "Socket closed"

The command

$ chmod a+x /path-to/apache-tomcat-8.5.15/bin/catalina.sh

to sufficiently change privileges worked for me.

查看更多
干净又极端
6楼-- · 2020-05-13 07:32

I have encountered the same error while using IntelliJ. Since I have started multiple instances of IntelliJ. While starting two instance it started properly. However, when starting another one, it was giving below error.

unable to open debugger port (127.0.0.1:debug-port-number) java.net.socketexception interrupted function call accept failed

There are basically two places you can check your ports related to debugging in IntelliJ

  1. JMX port - you can find this is enter image description here
  2. In Startup/Configuration, there is debug option just click this. enter image description here

What to Check: If IntelliJ is throwing above error, means issue is any of the above listed ports. To verify this open event log (its available in right corner down) and check the exact message. Event log will have message like below

11:19 PM    Error running 'Tomcat-tp': Address localhost:1098 is already in use

11:19 PM    Error running 'Tomcat-tp': Unable to open debugger port (127.0.0.1:51787): java.net.SocketException "Interrupted function call: accept failed"

Solution-1 Check the JMX port of current intelliJ which is not starting with the working one and verify if JMX ports are not duplicated within IntelliJ instance or any of the software which is running in your machine is not using this port.

Solution-2 If JMX is not duplicated then verify your debug port, check in all IntelliJ instance and do the changes.

Surely either JMX or Debug port is having issue just use unique JMX and Debug port and it will work.

Hope this will help someone.

查看更多
戒情不戒烟
7楼-- · 2020-05-13 07:33

Change debug port of your server configured in the Intelli J.

It will be fixed.enter image description here

查看更多
登录 后发表回答