TomcatDebug

HomePage | RecentChanges | Preferences

Debugging Tomcat with JSwat

These were written pre JSwat 3.0

> catalina.bat jpda start

You should see the following in the Tomcat console:

Listening for transport dt_shmem at address: jdbconn

An example jswat.bat file for a particular project:


set srcpath=C:\apache\struts-1.2.7-src\src\share
set srcpath=%srcpath%;E:\path\to\project\src\java
set srcpath=%srcpath%;E:\path\to\otherproject\src\java
set srcpath=%srcpath%;c:\jakarta\jakarta-tomcat-4.1.30-src\catalina\src\share
set srcpath=%srcpath%;c:\jakarta\jakarta-tomcat-4.1.30-src\jasper\src\share

set CLASSPATH=%JSWAT_HOME%\jswat.jar;%JAVA_HOME%\lib\tools.jar

java -Djava.source.path=%srcpath% com.bluemarsh.jswat.Main "attach jdbconn"


To start debugging:

  1. Execute jswat.bat (example above)
  2. It should connect automatically with "attach jdbconn" in the script. If not:
  1. Navigate your webapp to get the classes to load
  2. Choose the 'classes' tab at the top left
  3. Navigate to the class you're interested in
  4. Set a breakpoint by clicking the line number-- it will turn green
  5. Navigate the webapp in your browser
  6. When you hit the breakpoint, return to JSwat
  7. F11 steps one line at a time, F2 will finish the current method

HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited December 15, 2005 10:18 pm by WendySmoak (diff)
Search: