Hi, I am trying to use remote debugging in my IDE (Intelli-J IDEA). However I am not able to connect for some reason and am receiving the following exception. Any ideas?: Failed to establish connection to the target VM at 'localhost:8080' using socket transport. Process not started. Unable to launch target VM : java.net.ConnectException "Connection refused: connect"
Looks like it's trying to use port 8080 instead of 5005
Andy Hahn
Ranch Hand
Joined: Aug 31, 2004
Posts: 225
posted
0
I misstated the previous post. The exception I am receiving is: Failed to establish connection to the target VM at 'localhost:5005' using socket transport. Process not started. Unable to launch target VM : java.net.ConnectException "Connection refused: connect"
Andy Hahn
Ranch Hand
Joined: Aug 31, 2004
Posts: 225
posted
0
I figured it out. I had to start Tomcat in debugger mode. To do this I had to add a few parameters to catalina.bat:
set _EXECJAVA=%_RUNJAVA% set MAINCLASS=org.apache.catalina.startup.Bootstrap set ACTION=start set SECURITY_POLICY_FILE= set DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 set JPDA=
Also, if you run Tomcat using the jar, it will not pick up these changes. You would have to start Tomcat using startup.bat.