|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON WebSphere Development Demystifying Class Loading Problems
Part One of a Four-Part Article
Mar. 22, 2006 02:00 PM
Classes are often loaded through a combination of explicit and implicit class loading. For example, a class loader could first load a class explicitly and then load all of its referenced classes implicitly.
Debugging features of the JVM Verbose outputYou can turn on the IBM JVM's verbose output by using the -verbose command-line option. Verbose output displays information on the console when certain events occur -- when a class has been loaded, for instance. For additional class loading information, you can use verbose class output. This is activated using the -verbose:class option.
Interpreting verbose output
... All the classes that are loaded are listed, along with the JAR file or directory from which they were loaded. For example:
... Verbose class output shows additional information, such as when superclasses are being loaded, and when static initializers are being run. Some example output follows:
... Verbose output also shows some internally thrown exceptions (if they occur), including the stack trace.
Resolving problems using -verbose IBM Verbose Class LoadingIt is often useful to know where class loaders look for classes and which class loader loads a particular class. You can obtain this information using the IBM Verbose Class Loading command-line option: -Dibm.cl.verbose=<class name>. You can use regular expressions to declare the name of the class; for instance, Hello* traces any classes with names starting with Hello. This option also works on user-defined class loaders, as long as they directly or indirectly extend java.net.URLClassLoader.
Interpreting IBM Verbose Class Loading output java -Dibm.cl.verbose=ClassToTrace MainClass Here, MainClass references ClassToTrace in its main method. This would produce output similar to the output here. The class loaders are listed with parents before children because of the way that the standard delegation model works: Parents go first. Notice that there is no output for the bootstrap class loader. Output is only produced for class loaders that extend java.net.URLClassLoader. Note also that class loaders are listed under their class name; if there are two instances of a class loader, it may not be possible to distinguish between them.
Resolving problems using IBM Verbose Class Loading JavadumpA Javadump (also know as a Javacore) is another IBM diagnosis tool that you may find useful; to learn more about it, see the IBM Diagnostics Guide (see Resources for a link). A Javadump is generated by the JVM when one of the following events occurs:
YOUR FEEDBACK
WEBSPHERE LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING WEBSPHERE NEWS
|
||||||||||||||||||||||||||||||