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".
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.
I solved the issue by this way.
See these links for more information:
Delete Tomcat
Add a new Tomcat
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
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
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 runshutdown
.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 thentskill <pid>
). The only thing that finally helped was starting and shutting down tomcat manually viastartup.bat
andshutdown.bat
(you should use correspondig.sh
files on linux and macOS).