Cannot start Apache Tomcat 6 from IntelliJ IDEA 12.1.4 Ultimate (Windows 7)

Mentiflectax picture Mentiflectax · Sep 11, 2013 · Viewed 51.8k times · Source

I need to debug a web application for Tomcat6 in IntelliJ IDEA.

When I try to run my web application, I get two errors:

  1. Address localhost:1099 is already in use
  2. Unable to open debugger port: java.net.SocketException

Launching the Apache Tomcat 6 service manually works fine.

What should I do in order to be able to debug web applications in Apache Tomcat 6 from Intellij IDEA?

Answer

varna picture varna · Nov 3, 2015

Following the below steps work:-

  1. Open command prompt and type the command netstat -ano
  2. You will see a list of active TCP connections with PID as the last column
  3. See the second column listing the local addresses and find the one using port 1099 from it and you'll get its PID
  4. Now open your Task Manager, click the Process tab and get the PID column to display [either by right clicking on the heading row and selecting PID OR click View, and then click Select Columns and select PID.]
  5. Now find the PID we got from Step3 and end the process.

Now you are good to go :)