Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Assumptions

  1. Mac OS environment
  2. Java 1.4.2 installed
  3. Tomcat 5.5.x installed together with Compat *.jar
  4. Maven installed and build.properties defined
  5. Eclipse 3.1.x installed
  6. MyEclipse 4.0.x installed (optional)

Setup

1. Environment: set JPDA variables (e.g., saved in .bash_profile)

Set the Java Debug Wire Protocol (JDWP) for the connection and the port the debugger will use to communicate with the JVM, typically port 8000. Add lines, save and restart system.

# Eclipse Debugging
JPDA_TRANSPORT=dt_socket; export JPDA_TRANSPORT
JPDA_ADDRESS=8000; export JPDA_ADDRESS

However, I recently discovered that a certain application (unknown at present though I did install Microsoft Office 2004) is squatting on Port 8000 and preventing the debugger from launching. So I reset my JPDA address to Port 8001 and changed the port address in the Eclipse debugger and all is well again.

# Eclipse Debugging
JPDA_TRANSPORT=dt_socket; export JPDA_TRANSPORT
JPDA_ADDRESS=8001; export JPDA_ADDRESS
2. Tomcat: start in debug mode
arwhyte $ cd $CATALINA_HOME
tomcat $ catalina.sh jpda start
3. Eclipse: set breakpoint(s) in code and switch to Debug Perspective

Debug Perspective: Window > Open Perspective > Debug > Other > Debug

Click on Bug icon, click Debug... and launch debug configuration wizard. Select Remote Java Application, click New and define the following settings:

  1. Connect
    • Name: SakaDebug
    • Project: leave blank
    • Connection Type: Standard (Socket Attach)
    • Host: localhost
  2. Port: 8000 or 8001 (as defined above)
  3. Source
    • Click Add and select Java Project icon
    • Click Select all projects (note to self only: deselect local database project)
    • Uncheck Add exported entries of selected projects (otherwise references to Maven_Repo, etc. are added)
      #Common
      #*Stay with defaults
  4. Click Apply (debug session should start, otherwise click Debug icon and click on named debug profile)
  • No labels