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条回答
The star\"
2楼-- · 2020-05-13 07:46

In my case I had another project open in IntelliJ, and had Tomcat running in debug mode in that project. Stopping that instance of Tomcat resolved the issue.

查看更多
唯我独甜
3楼-- · 2020-05-13 07:49

I solved the issue by this way.

  1. I tried to kill all the java.exe processes but it was useless.
  2. Then I tried deleting the Tomcat server
  3. I re-deployed the project and restarted the project and it worked.

See these links for more information:

Delete Tomcat Delete Tomcat

Add a new Tomcat Add a new Tomcat

查看更多
叼着烟拽天下
4楼-- · 2020-05-13 07:51

There are various reasons for this.
- There might be the problem with debugger port---Please change it to resolve( answered by T.M )
- There might be some issue with intellij cache --Invalidate cache and restart will solve it ( answered by feng smith )
- There might be problem with any other Port, like JMX, AJP --- Please change these port numbers as well.
I wanted to add this as comment but not enough rep

查看更多
Explosion°爆炸
5楼-- · 2020-05-13 07:51

In my case, there was a problem in server.xml for Tomcat/conf folder where I had extra comment tags under another comment tag. So I think, since there was some problem in server.xml, it was not able to start Tomcat. And moreover it copies the tomcat folder from your installation directory to C:\Users\username.IntelliJIdea2017.2\system\tomcat\Tomcat_service

查看更多
ら.Afraid
6楼-- · 2020-05-13 07:52

I had this exact message.

The reason was that some IDE (I use Eclipse and Intellij) failed to shutdown the tomcat server. Or maybe crashed before it could do so.

The solution was to navigate to C:\...\apache-tomcat-xxx\bin and run shutdown.

查看更多
贪生不怕死
7楼-- · 2020-05-13 07:52

None of above methods worked in my case i.e. changing port number in run configuration, machine restart, invalidate cache in IntelliJ, killing process shown in netstat (nestat -anob | findstr <port-number> and then tskill <pid>). The only thing that finally helped was starting and shutting down tomcat manually via startup.bat and shutdown.bat (you should use correspondig .sh files on linux and macOS).

查看更多
登录 后发表回答