Remote debugging with IDEA 5 and Tomcat

I'm using IDEA 5 build 3487 and Tomcat 5.5.9 on Windows 2000. IDEA and Tomcat are on the same machine. I've tried to set up remote debugging according to the docs.

In Tomcat I edited catalina.bat to include...
set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

I also opened the "Configure Tomcat" utility that came in the Tomcat distribution and under that utility's "Java" tab added a line to "Java Options" so that it is now set to...
-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5
-Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed\Program Files\Apache Software Foundation\Tomcat 5.5\temp
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

In IDEA I went to Run/Debug Configurations and added a new configuration under the "Remote" tab with all the default settings. (Is there normally any need to change any of the defaults?)

Under Settings > Project Settings > Compiler I made sure "Generate debugging info" is set.

When I start Tomcat then click the debug icon in the toolbar, an error dialog comes up saying...

"Error running Tomcat localhost remote debug: unable to open debugger port : "connection refused: connect" at 'localhost 5005' using socket transport."

Any help would be greatly appreciated.




this is my steps for remote debug

1. modify last line of startup.bat
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

2. open catalina.bat
this file already contain commands for remote debug, see *:doJpda *label,so just add two ENV variables named JPDA_TRANSPORT and JPDA_ADDRESS

3. config IDEA create a remote debug instance

hope helpful


Thanks for the reply.

I found that my configuration described above actually can work if I start Tomcat by opening a DOS window and running startup.bat. Then start a debugging session from within IDEA by clicking on the debug icon.

When I do that the message "Connected to the target VM at 'localhost:5005' using socket transport" appears in IDEA's "Console" panel.

If I get a chance I'll try the method you mentioned.




Please sign in to leave a comment.