Devtest Debugging

Here's how to debug devtest clients using NetBeans:

  1. In console window A, cd to the directory with the devtest you want to debug.
    Edit the build.xml file.
    Find the <target name="runclient" ...>.
    1. If the test runs with Java SE, inside the <java> or <javaWithResult> element add <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=9009,server=y,suspend=y"/>.
    2. If the test runs an app client, inside the <exec> element before the first <arg> element, add <arg value="-agentlib:jdwp=transport=dt_socket,address=9009,server=y,suspend=y"/>.
    3. Save the build.xml.
  2. In NetBeans, open the class you want to breakpoint in (can be a JDK class).
    (Navigate > Go to Type... : enter the class name and choose the correct one if there are multiple.)
    Set a breakpoint.
  3. Back in window A (still in the devtest subdirectory), run "ant all".
    After a bit it says the debugger is listening on 9009.
  4. Back in NetBeans, connect the debugger (Debug > Attach debugger...) to 8118 and go.
    Hope one of the breakpoints is hit.

To debug the server when running devtests:

  1. Edit domain.xml. Find the <java-config> element under the <config name="server-config"> element.
  2. Change the suspend=n string to suspend=y.
  3. Start the server using asadmin start-domain --debug. You might also want to use --version.
  4. In NetBeans, set breakpoints and attach the debugger as above.