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 into 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
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 a plethora of details on the variety of ways to configure log4j in its manual
. Probably the simplest way is to ensure that your configuration file is named log4j.properties and place it somewhere on your classpath (e.g., in one of your jars). If you are debugging an Introduce-generated client, you can 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 the configuration file, 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 into 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
# 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:

$CATALINA_HOME\bin\catalina.sh jpda start
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 look-up path as required for your code.
- Debug.
You should hit your breakpoint and be able to step through the code to determine the root problem.
Launch the Ant build in run mode.





