debuggingtomcatintellij-ideawar

Debugging 2 webapps in the same Tomcat


I'm looking for a way to deploy 2 different webapp projects (not opened in the same IntelliJ window). I have created 2 distinct debug configurations that both target the same tomcat which is run separately (i.e. it is not started via IntelliJ). However once one of the 2 applications is deployed in debug mode it seems that it hogs the debugging port and the other one might deploy successfully but it is impossible to debug it. I also tried with shared memory and I tried to connect 2 remote debug configurations which also resulted in a failure. I even tried to deploy both applications from one Debug configuration inside IntelliJ and remotely connect the debugger of one of the applications from another instance of IntelliJ and it still fails.

What is the correct way to debug 2 distinct webapps that are deployed under the same tomcat server?


Solution

  • The answer, as mentioned by @CrazyCoder is to deploy both applications in the same Run/Debug configuration in the deployment tab. The simplest way to do this is to add them as an External Source and add the web directory which contains the WEB-INF.