Access Keys:
Skip to content (Access Key - 0)

Knowledgebase


Debug caGrid


If you are using the Globus container, make sure you pass the -debug flag when you start the container.

Logging Information

Use log4j in Tomcat

Begin by copying the required logging libraries in to your tomcat container.

 cp $GLOBUS_LOCATION/lib/log4j-1.2.8.jar $CATALINA_HOME/webapps/wsrf/WEB-INF/lib 
cp $GLOBUS_LOCATION/lib/commons-logging.jar $CATALINA_HOME/webapps/wsrf/WEB-INF/lib

Edit $CATALINA_HOME/webapps/wsrf/WEB-INF/classes/log4j.properties to log the classes and packages you wish to debug.

NOTE: The default Tomcat log file location is $CATALINA_HOME/logs/catalina.out

Use log4j in JBoss

JBoss already uses Log4J by default. The log4j configuration file is located at $JBOSS_HOME/server/default/conf/log4j.xml The default configuration logs messages to the console and a file ($JBOSS_HOME/server/default/log/server.log)

Note: The default console logger is configured with a message threshold level of INFO. DEBUG level messages and under will not appear on the console, but will appear in the log file.

Use log4j on the Client

To use log4j logging on the client, you will need to configure your client to load a log4j configuration file. You can find details (probably more than you want) on the variety of ways to configure log4j in its manual. Probably the simplest way is to just make sure your configuration file is named log4j.properties, and place it somewhere on your classpath (for example in one of your jars). If you are debugging an Introduce-generated client, you can just drop the file in your service's src folder and rebuild.

Turn on caGrid Debugging Log Messages

Edit your log4j.properties (see above) and add these lines:

log4j.category.gov.nih.nci.cagrid=DEBUG
log4j.category.org.cagrid=DEBUG

For problems with advertisement/registration to the index service, add these lines as well:

log4j.category.org.globus.mds=DEBUG
log4j.category.org.globus.wsrf.impl.servicegroup=DEBUG

If you're using log4j.xml as your configuration file, you'll add lines similar to:

<category name="org.cagrid">
    priority value="DEBUG"/>
</category>

<category name="gov.nih.nci.cagrid">
    <priority value="DEBUG"/>
</category>

Turn on Message Level SOAP Logging (slow!)

Begin by copying the required logging libraries in to your tomcat container.

 cp $GLOBUS_LOCATION/lib/log4j-1.2.8.jar $CATALINA_HOME/webapps/wsrf/WEB-INF/lib cp $GLOBUS_LOCATION/lib/commons-logging.jar $CATALINA_HOME/webapps/wsrf/WEB-INF/lib

Edit $CATALINA_HOME/webapps/wsrf/WEB-INF/classes/log4j.properties replace this line:

# log4j.category.org.globus.wsrf.handlers.MessageLoggingHandler=DEBUG

with this:

log4j.category.org.globus.wsrf.handlers.MessageLoggingHandler=DEBUG

Debug Services Running in Tomcat with Eclipse

Start Tomcat with the following command:

 $CATALINA_HOME\bin\catalina.sh jpda start

You may need to edit catalina.sh (or .bat in windows) to have these properties:

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket

In Eclipse, go to the Debug window and select new "Remote Java Application," select your service's project, and use the rest of the defaults. You should now be able to set breakpoints in your service's source code and debug it running in Tomcat.

SOAP Viewing

Make use of the Axis TCP monitor to view SOAP messages in transit

Debug ant Tasks Spawned by an Introduce Build Process

  • Set a breakpoint in your custom Ant task code.
  • Open the launch configuration dialog on the Ant config for the build to be debugged.
  • Go to the JRE tab.
  • In the VM arguments, specify for the VM to launch to enable remote debug:
"-Xdebug \-Xnoagent \-Djava.compiler=NONE \-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
  • The Ant build will launch and wait for a remote debug attach.
  • Top level Run menu > Debug.
  • Create a new Remote Java Application launch configuration.
  • Set the source lookup path as required for your code.
  • Debug.

You should hit your breakpoint and be able to step through the code to determine what is the root problem.

Launch the Ant build in run mode.

Last edited by
William Stephens (1014 days ago) , ...
Adaptavist Theme Builder Powered by Atlassian Confluence