When you include one or more JavaCompute nodes in a broker
archive (BAR) file, the JAR files are loaded in a separate classloader.
The classloader loads all classes that are packaged within the deployed
BAR. These classes override any classes that are in the shared classes
directory or the CLASSPATH environment variable.
The broker uses the following classloader tree:
These components are in the classloader tree:
- Common classloader: loads the classes that are shared between
the broker and user code. For example, the classes that are contained
in jplugin2.jar are common to the broker and the
user code.
- Broker classloader: loads the broker internal classes.
These classes cannot be accessed by user classes.
- Shared classloader: loads classes from JAR files
that have been placed in the workpath/shared-classes/ directory,
and from the CLASSPATH environment variable. These
classes are available to all Java nodes within the broker.
- EGShared classloader: loads all classes that are deployed
to the execution group in the broker archive (BAR) file, either by
a JavaCompute node or an
ESQL-to-Java mapping.
The broker uses the following search path to find JavaCompute node classes:
- The deployed JAR file
- <WorkPath>/shared-classes/ to locate any JAR
files
- The CLASSPATH environment variable