Java Dynamic Management Kit 3.2 Programming Guide | ||||
---|---|---|---|---|
![]() | ![]() | Chapter 9. Troubleshooting | ![]() |
The class com.sun.jaw.reference.common.Debug provides methods for printing debug messages. Options provided by this class enable you to specify:
The trace level
The destination of the debug messages printed
All the classes of the Java Dynamic Management Kit use the Debug class for printing debug traces. You can use the Debug class in your own code for printing debug traces for your own classes.
It is possible to specify the trace level for a class in either of the following ways:
At the command line when you start the Java interpreter to run the class
In the code of the class itself
To specify the trace level at the command line, specify system properties in the command to start the Java interpreter when you run the class. In this case, the code of the class must include a call to the parseDebugProperties() method of the com.sun.jaw.reference.common.Debug class. The default base agent includes a call to the parseDebugProperties method. The system properties for specifying the trace level are listed in the API reference information for the com.sun.jaw.reference.common.Debug class.
To specify the trace level in the code of a class, call one of the static functions of the com.sun.jaw.reference.common.Debug class listed in Table 9-1.
Table 9-1. Methods for Specifying the Trace Level
Function | Action |
---|---|
Debug.setOnAll(); | Enables all traces |
Debug.setOn(int l); | Enables a specific trace level |
Debug.setOffAll(); | Disables all traces |
Debug.setOff(int l); | Disables a specific trace level |
The trace levels are listed in the API reference information for the com.sun.jaw.reference.common.Debug class.
To specify that debug messages are logged to a file, specify this system property:
DEBUG_OUTPUT=filename |
where filename is the name of the file, including the path, to which you want debug messages to be logged.
If you do not specify this system property, debug messages are printed to the terminal.
Before starting the default base agent in debug mode make sure that:
It is not already running. For information on how to stop the default base agent, refer to Appendix E.
The class path of this agent specifies the location of the Java Dynamic Management Kit classes.
To start the default base agent in debug mode, type:
prompt% java -DDEBUG com.sun.jaw.impl.base.Main |
For the Solaris operating environment, a command is provided to enable you to start the default base agent in debug mode without starting the Java interpreter explicitly. To use this command, type:
prompt% installDir/SUNWconn/jaw/bin/jaw debug |
The debug messages printed are shown in Example 9-1.
Example 9-1. Debug Messages from the Default Base Agent
Default debug is on Repository configuration done cmf: Initializing domain defaultDomain cmf::addObject: name= defaultDomain:com.sun.jaw.reference.client.mo.FrameworkMO RepositorySrv::register: addNewDomClassMoi dom = defaultDomain name = defaultDomain:com.sun.jaw.reference.client.mo.FrameworkMO addNewDomClassMoi: register: ClassName = com.sun.jaw.reference.client.mo.FrameworkMO Repository.register: name= defaultDomain:com.sun.jaw.reference.client.mo.FrameworkMO Got domain = defaultDomain RepositorySrv:: tab == null for dom = defaultDomain cla = com.sun.jaw.reference.client.mo.MetaDataSrvIfMO Metadata service not found, adding com.sun.jaw.impl.agent.services.light.MetaDataSrv cmf::newObject: load com.sun.jaw.impl.agent.services.light.MetaD ataSrv, name= defaultDomain:com.sun.jaw.reference.client.mo.Meta DataSrvIfMO RepositorySrv:: tab == null for dom = defaultDomain cla = java.lang.ClassLoader cmf::getClass: use default loader for loading com.sun.jaw.impl.agent.services.light.MetaDataSrv cmf::getClass: was able to load com.sun.jaw.impl.agent.services.light.MetaDataSrv ... |
![]() | ![]() | ![]() |
Troubleshooting | ![]() | Setting the Class Path |