Unexpected Annotatedclassnotfoundexception When Loading Metric Collector Class
Last updated on OCTOBER 20, 2017
Applies to:Oracle Containers for J2EE - Version: 10.1.3.0.0
This problem can occur on any platform.
You have implemented a custom metric collector for the Oracle Containers For J2EE (OC4J) component of
Oracle Application Server 10g version 10.1.3.0.0
- packaged the implementation of your custom metric in a JAR file, for example MyCustomDMSMetric.jar
- placed that JAR file in the "applib" directory of the OC4J instance where you will be using it
- added an appropriate <metric-collector> tag to the config/server.xml configuration file:
You may have also tried adding the JAR file location as a "code-source" for a <shared-library> definition in sever.xml:
<shared-library name="my.custom.metric" version="1.0">
and added an "import" for the shared library in the <imported-shared-libraries> section of system-application.xml:
However, at startup time you receive an AnnotatedClassNotFoundException exception, similar to the following:
Missing class: my.package.MyMetricCollector
Dependent class: com.evermind.server.OC4JMonitorThread
Configuration: <code-source> in META-INF/boot.xml in
This load was initiated at oc4j:10.1.3 using the Class.forName() method.
The missing class is available from the following locations:
1. Code-Source: /path/to/MyCustomDMSMetric.jar
(from <code-source> in /u01/app/oracle/mid1013a/j2ee/home/config/server.xml)
This code-source is available in loader my.custom.metric:1.0.
This shared-library can be made visible to the "oc4j" loader by modifying
the boot descriptor.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms