Java Class Trace Tool
The
Java Class Trace Tool
allows you to test the Java classpath resolved by a module by
requesting a match for particular Java classes.
As described in the
module overview
section of the Solution Developer Guide
a module uses its own custom Java classloader to load and manage Java classes.
In the larger context, a module may import other modules (with their own Java classes and classloaders)
and may also delegate to the NetKernel Boot Class Loader and the Java Runtime Environment (JRE) classloader.
The Java Class Trace tool allows you to test for specific classes and determine which classloader
brought them into memory.
The tool is very easy to use.
Simply select a deployed module from the drop down list,
enter the Java class name you are testing into the "Class" field
"Resolve" button.
Usage Scenarios
The class trace tool is used in the following situations:
- To test that a Java component is built and available in a module.
- To test that a local library class is correctly located from a jar in the module lib/ directory
- To test that a class is being provided from an imported module.
- To test that a class is being provided from the extended library's loaded from [install]/lib/ext/
- To test that a class is being provided from the JVM classloader
- To discover which jar or file a class is loaded from when it could be ambiguous.
The class trace tool allows the full dynamic and modular NetKernel classpath to be probed and understood.
It is the first tool to turn to if you need to integrate existing Java libraries with NetKernel.
Example
Using the tool, select the module urn:org:ten60:tutorial
.
Enter the Java class org.ten60.netkernel.tutorial.HelloWorld
and press the resolve button.
The tool will display the Java classpath it searches and that the
class is located in the module class loader in the module
urn:org:ten60:tutorial
.
Example
Using the same setting as the example above enter the
Java class java.lang.String
and press the resolve button.
You will see that the class is located in the bootstrap class loader in the JRE.
Example
Using the same setting as the example above enter the
Java class org.ten60.netkernel.layer1.util.Utils
and press the resolve button.
You will see that the class is located in the module class loader
for the module urn:org:ten60:netkernel:ext:layer1
,
an internal NetKernel module.