Get started

Adding SelfDiagnose to your existing project requires the following steps:
  • Installing SelfDiagnose
  • Adding tasks to a configuration
  • Running tasks and view the report

Installing SelfDiagnose

  1. Add selfdiagnose-{version}.jar to the classpath of the (web)application
  2. Make sure the log4j-{version 1.2.8 or higher}.jar is on the same classpath
  3. Make sure the ognl-{version 2.6.11 or higher}.jar is on the same classpath. (see Open Symphony Object Graph Navigation Language).
  4. Add the SelfDiagnoseServlet to your Web Deployment Descriptor:
						
<!-- SelfDiagnose - Servlet -->
<servlet>
	<servlet-name>SelfDiagnoseServlet</servlet-name>
	<display-name>SelfDiagnose</display-name>
	<servlet-class>
	  com.philemonworks.selfdiagnose.SelfDiagnoseServlet
	</servlet-class>
</servlet> 	  

<!-- SelfDiagnose - Mapping -->	  	  
<servlet-mapping>
	<servlet-name>SelfDiagnoseServlet</servlet-name>
	<url-pattern>/selfdiagnose/*</url-pattern>
</servlet-mapping> 
					

Adding Tasks

Registration of diagnostic task can be done directly in Java or by configuration in XML. Create the file name selfdiagnose.xml and place it in a source folder (e.g. WebContent) such that this resource can be found on the classpath.

						
<?xml version="1.0" ?>				
<selfdiagnose 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:noNamespaceSchemaLocation="http://selfdiagnose.sourceforge.net/selfdiagnose-2.4.xsd">
	
	<tasks>
		<checksystemproperty property="java.version" />
	</tasks>
</selfdiagnose>
					

Running SelfDiagnose

The following request to the SelfDiagnoseServlet will run the diagnostic tasks and return an HTML page showing the results.

http://{your host:port}/{your context}/selfdiagnose