Wednesday, April 02, 2008

How To: Debug Web Applications on Tomcat with JPDA

Suppose you want to debug a servlet in eclipse.

WINDOWS:-

Step 1: Change your catalina.bat with the following changes


if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
set JPDA_TRANSPORT=dt_socket
:gotJpdaTransport
if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
set JPDA_ADDRESS=8787


Step 2: Start Tomcat with

catalina start jpda


Step 3: Open your debug dialog in Eclipse. Add a remote java application with port "8787".

UNIX/LINUX:
No change really needed.

$>./catalina.sh jpda start
$>./catalina.sh jpda stop

Eclipse needs to have a remote java application with port "8000"

No comments: