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
Prepare to write an analyzer
You do not need any special setup in order to write an analysis module, just access to the required JAR files. However, before you start to write an analyzer you will need to choose an environment in which to develop the code. It is possible to operate with just a text editor and then use javac to compile the resulting Java code but it is generally more convenient to use an Integrated Development Environment (IDE). If you choose Eclipse as the environment then the following instructions describe the typical setup.
To develop an analysis module within Eclipse:
- Download and install Eclipse.
- Create a new Java project.
- Add dumpAnalyzer.jar to the project classpath.
- Add the DTFJ jars to the project's classpath.
Instructions for downloading Eclipse can be found by following the download link on the Eclipse home page (see download). Once installed switch to the Java Perspective (Window > Open Perspective > Java). In this perspective create a new Java Project:
- Navigate to File > New > Project.
- Select Java Project and click Next.
- In the resulting wizard:
- Enter
AnalysisModule
for the project name.- Ensure that Create new project in workspace is selected.
- Ensure the Create separate folders for sources and class files in the Project layout section is selected.
- Click Finish.
There are six JAR files that need to be on the classpath of the AnalysisModule project:
- dumpAnalyzer.jar (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda_(version number))
- 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)
- coreAnalyzers.jar (found in toolsDir/plugins/com.ibm.java.diagnostics.dbda.core_(version number))
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\ <user ID>\IBM\ISAv4\applications\eclipse
; on Linux it is a subdirectoryIBM/ISAv4/applications/eclipse
under the user home directory).If we have installed extensions to the Dump Analyzer tool (for example the WebSphere Application Server modules), you may need to add additional jar files provided by these extensions. Refer to the documentation for each extension for further information about the jar files that they provide.
To add these JAR files to the classpath within Eclispe:
- Right-click on the AnalysisModule project.
- Navigate to (Java) Build Path > Configure Build Path.
- In the Libraries tab of the Build Path properties, select Add External Jars. Navigate to the four JAR files denoted above and add them to the build path.
- Use the Order and Export tab along with the Up and Down buttons to ensure they appear in same order as they are in the list above.
- Click OK to save the changes.
It's advisable that you write your analysis module class within a package.
To create a package within your AnalysisModule project:
- Right-click on the AnalysisModule project.
- Navigate to New > Package.
- Enter
mypackage
in the resulting wizard
- Click Finish.
Your environment is now ready for you to write an analysis module.