Thursday, January 22, 2009

Debug Tomcat and JBoss Web-application in Eclipse

1. configure tomcat to allow remote debugging
ensure the startup.bat includes:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket

or startup.sh includes:
export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket

and update the execute line to inlcude(the first line for startup.bat, the second line for startup.sh):
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"


2. configure jboss to allow remote debugging
ensure the JAVA_OPTS in your jboss run.sh or run.bat includes:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y


3. configure eclipse to remote debug
go into 'debug' in eclipse and new a remote debug application, remember apply 'port number' to web application server debug port, in this case, this port number is 8787, not 8080.

No comments:

Post a Comment