Previous Next Contents Index


9


Troubleshooting

This chapter explains how to use the debug class to print debug messages. It also describes some common problems and suggests how to solve them.


Printing Debug Messages

The class com.sun.jaw.reference.common.Debug provides methods for printing debug messages. Options provided by this class enable you to specify:

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.

Specifying the Trace Level

It is possible to specify the trace level for a class in either of the following ways:

Specifying the Trace Level at the Command Line

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.

Specifying the Trace Level in the Code of a 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.

Specifying the Destination of Debug Messages

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.

Starting the Default Base Agent in Debug Mode

Before starting the default base agent in debug mode ensure that:

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% /opt/SUNWconn/jaw/bin/jaw debug

The debug messages printed are shown in CODE EXAMPLE 9-1.


CODE  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
...


Setting the Class Path

Make sure that the CLASSPATH environment variable specifies the correct location of:


Threads With Native Methods

If a native library is not multithread-safe, using JNI to call routines implemented in the native library can cause the Java virtual machine to fail. To avoid multithreading problems with native libraries, include the Synchronized clause in your Java calls to functions in native libraries.

If a call to a routine implemented in the native library causes the Java virtual machine to fail:


Getters and Setters in a C-Bean

If you want getter and setter methods in an m-bean to be present in c-beans generated by mogen, they must conform to the JavaBeans component model. For example, the following method is not a getter method as defined by the JavaBeans component model:

getX(A a, B b)

Therefore, mogen does not generate this method in a c-bean. If you want to define a method that gets the value of several attributes, and if you want that method to be present in a c-bean generated by mogen, define the method as an action by including the perform prefix in the method name:


performGetX( A a, B b)


Missing Value Change Events

A VALUE_CHANGE_EVT event is emitted only when properties are changed through the framework, as described in "Setting a Property" on page 50. If a property is modified by its setter method, the framework is not informed and no event is sent.


Adaptor Client Local Exceptions

The getObject method of an adaptor client is successful only if all the c-bean classes are present at a location defined in the CLASSPATH environment variable of the manager. If a c-bean class is not present, a LocalException is thrown. A LocalException at the client wraps a ClassNotFound exception thrown at the agent.



Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California 94303 U.S.A.
Copyright in French

Previous Next Contents Index