Express (Distributed operating systems), v8.0 > Troubleshoot and support > Analyzing application server Java system dumps with the IBM Monitoring and Diagnostic Tools for Java - Dump Analyzer > Write a new analysis module or script > Write and running a new analysis module
Run an analyzer
The three places you may wish to run your analyzer are in Eclipse, in the IBM Support Assistant (ISA) and on the command line. We can either run your analyzer in isolation or as part of a script (see How to link your analyzers together using the scripting language for details about running as part of a script).
How to run your analyzer in Eclipse
The easiest way to run the Dump Analyzer within Eclipse is to run the
DumpAnalyzer.main()
method and pass in the fully qualified dump name you wish to analyze.To do this:
- Select the "Dump Analyzer" project within the package explorer
- Right click and select "Run As > Open Run Dialog"
- In the left hand pane highlight "Java Application" and click the "New" button
- In the details for the newly created configuration (right hand pane):
- Main tab: browse to the DumpAnalyzer project
- Main tab: Main class - search and find com.ibm.dtfj.analyzer.base.DumpAnalyzer class
- Classpath tab: Select Bootstrap entries and click "Add Jars"
- Add the three DTFJ jars added to the classpath of your project in the Prepare to write an analyzer section using the "up" and "down" buttons to ensure they appear in that order before the JRE System Library.
- Arguments tab: add the fully qualified dump name to the program arguments
- Click "Run" and the Dump Analyzer will run sending the output to the console view (note that if this view doesn't appear automatically, it can be opened by navigating to Window > Show View > Console).
How to run your analyzer from the command line
To run your analyzers from the command line it is advisable that you first package them into a jar file called analyzers.jar. We can either do this using the jar command or by the following steps in Eclipse:
- Right click on your AnalysisModule within Eclipse
- Select Export
- Navigate to Java > Jar File
- Select only the source from the AnalysisModule project
- Ensure Export generated class files and resources is selected
- Enter the fully qualified path for the analyzers.jar
- Click Finish
To run from the command line the 4 jar files
- dtfj-interface.jar (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda_(version number)/lib/j9)
- dtfj.jar for Java 5.0 and above (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda_(version number)/lib/j9)
- dtfj.jar for Java 1.4.2 (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda_(version number)/lib/sov)
dtfjsu.jar for Java 1.4.2 (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda_(version number)/lib/sov)
need to be added to the bootstrap classpath and the
- dumpAnalyzer.jar (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda_(version number))
- coreAnalyzers.jar (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda.core_(version number))
needs to be added to the classpath. In all of the file paths above, toolsDir denotes the directory where ISAv4 installs the tools (on Microsoft Windows, this is by default C:\Documents and Settings\Administrator\IBM\ISAv4\applications\eclipse).
For this example the 6 jar files have been copied from the above location to the directory which contains your analyzers.jar package. The command to run your analyzers is
java -cp (list of analyzer jar files) -Xbootclasspath/p:(list of DTFJ jar files) com.ibm.dtfj.analyzer.base.DumpAnalyzer (name of dump) (analyzer to run)For example, on a Windows command line the command to run the IRpoert analyzer example written in the Write an analyzer that implements IReport is
java -cp dumpAnalyzer.jar;coreAnalyzers.jar;analyzers.jar -Xbootclasspath/p:j9/dtfj.jar;j9/dtfj-interface.jar;sov/dtfjsu.jar;sov/dtfj.jar com.ibm.dtfj.analyzer.base.DumpAnalyzer 20070307.dmp.zip mypackage.DWReportwhich gives the output
DumpAnalyzer V:1.0.2.20070906163649 starting analysis of 20070307.dmp.zip 14-Sep-2007 09:35:57 com.ibm.dtfj.analyzer.base.ImageContext initializeImageFactory WARNING: Image factory generation failed com.ibm.dtfj.image.sov.ImageFactory ================================ Error Summary ================================= No errors =============================== Analysis results =============================== DumpAnalyzer V:1.0.2.20070906163649 : Start analysis of F:\20070307.dmp.zip Image created on Windows XP
How to run your analyzer in ISA
To run your own analyzers through ISA package them into a jar file stored on your local file system. To create the jar file follow the instructions at the beginning of the How to run your analyzer from the command line section. Once the jar is created it can be added to Dump analyzer using the 'add analyzers' option on the launch screen menu. See also the Load a new analysis module section. disclosure restricted by GSA ADP Schedule Contract with IBM Corp.