starman1979
starman1979

Reputation: 1064

Intellij debugging tomcat

I know this has been asked a few times already but none of the posted solutions seem to help. I'm trying to debug an application deployed on Tomcat installed locally.

Starting tomcat with these options:

set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 %JAVA_OPTS%

Created a remote debug configuration (NOT tomcat remote) and connecting to localhost/127.0.0.1 on port 8000. I get this error:

Unable to open debugger port (localhost:8000): java.io.IOException "handshake failed - connection prematurally closed"

I should mention that I have done this same setup many times before and never faced any issue. No idea why this is happening now.

Thanks for any help!

Upvotes: 3

Views: 10817

Answers (2)

ENG_ACK
ENG_ACK

Reputation: 108

To scale across multiple machines, you can leave the Host field value blank and just fill in the port. Blank values default to the local machine's hostname. Tested on Intellij Ultimate 2016.2. This is an issue with Intellij as jdb attaches fine.

Screenshot below of working settings: enter image description here

Upvotes: 0

starman1979
starman1979

Reputation: 1064

Ok solved it. For some reason localhost/127.0.0.1 were not working. So i tried the full host name and it worked.

Upvotes: 8

Related Questions