CaGrid Debugging

From Informatics

Jump to: navigation, search

Contents

Configuring Logging

Client Side Logging

To configure logging on the client side, do the following:

  • Create a log4j.properties file and add it to the build path.

To configure logging on the server side (ie. on Tomcat), do the following:

  • Open the axis.jar that lives on the server side and remove log4j.properties (you can do this in winzip).
  • Add a log4j.properties file to your webapp i WEB-INF/classes.

See also: http://ws.apache.org/axis/java/reference.html#AxisLoggingConfiguration

If you just want to monitor SOAP request and responses, see below.

Server-side Logging

  • Make sure you have log4j.jar and commons-logging.jar in your $CATALINA_HOME/webapps/wsrf/WEB-INF/lib and modify $CATALINA_HOME/webapps/wsrf/WEB-INF/classes/log4j.properties to contain the pertinent packages. For instance, if you want to log both caGrid related information and your caGrid service information, add
#caGrid logging
log4j.category.gov.nih.nci.cagrid=DEBUG
#geWorkbench logging
log4j.category.edu.columbia.geworkbench.cagrid=DEBUG
log4j.category.edu.columbia.geworkbench.cagrid.som=DEBUG
#axis logging
log4j.category.org.apache.axis.transport.http=DEBUG

Monitoring SOAP Requests/Responses

Debugging Services

See also: Tomcat for tomcat setup instructions.

  • open $CATALINA_HOME\bin\catalina.bat (or catalina.sh on linux) and add the following:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
  • give more memory to the tomcat startup by replacing the doStart segment with
:doStart
shift
if not "%OS%" == "Windows_NT" goto noTitle
set _EXECJAVA=start "Tomcat" %_RUNJAVA% -Xmx700M
goto gotTitle
:noTitle
set _EXECJAVA=start %_RUNJAVA% -Xmx700M
:gotTitle
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
goto execCmd
  • Start tomcat from the command line with
catalina.bat jpda start
  • In eclipse, select Run->Debug.
  • Select Remote Java Application (left hand side). Select your project and use the default settings.
  • You should now be able to set breakpoints in your server-side code.
Personal tools