Enabling Tomcat Debugging#
Add the following in /etc/sysconfig/tomcat or /etc/sysconfig/tomcat@:
JAVA_OPTS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=<port>,server=y,suspend=y -Djava.security.debug=all"
Then restart Tomcat.
Connecting with JDB#
$ jdb -attach localhost:<port>