geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Meilinger (JIRA)" <>
Subject [jira] Created: (GERONIMO-4618) ClassNotFoundException for annotations defined in JAR files an used in EJB's deployed within an EAR
Date Thu, 09 Apr 2009 13:19:12 GMT
ClassNotFoundException for annotations defined in JAR files an used in EJB's deployed within
an EAR

                 Key: GERONIMO-4618
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: deployment
    Affects Versions: 2.1.4
         Environment: Linux 2.6.24 x86_64
            Reporter: Frank Meilinger
            Priority: Critical

We have an EAR fle with an EJB jar and a utils jar file. This Utils jar file contains an annotation,
which is used at the EJB Interface. The directory layout of the EAR file is defined in the
following way:

  |--- ejbs.jar
         | ---utils.jar

(the problem is the same, if we copy the utils.jar in the root directory of the EAR file).

When we deploy the EAR file we got the following error:

009-04-09 14:30:51,813 ERROR [Deployer] Deployment failed due to
java.lang.NoClassDefFoundError: a/b/c/OurAnnotation
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.getDeclaredMethods(
        at org.apache.xbean.finder.ClassFinder.<init>(
        at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.createInheritedClassFinder(
        at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(
        at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(
        at org.apache.openejb.config.AnnotationDeployer.deploy(
        at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(
        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.configureApplication(
        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.getEjbJarInfo(
        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.initContext(
        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(
        at org.apache.geronimo.deployment.Deployer.deploy(
        at org.apache.geronimo.deployment.Deployer.deploy(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(
        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(
Caused by: java.lang.ClassNotFoundException: a.b.c.OurAnnotation
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClassInternal(
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(
        at org.apache.geronimo.kernel.classloader.TemporaryClassLoader.loadClass(
        at org.apache.geronimo.kernel.classloader.TemporaryClassLoader.loadClass(
        at java.lang.ClassLoader.loadClassInternal(
        ... 27 more

The Annotation in this sample has the name "a.b.c.OurAnnotation".

The problem only disappear, when we copy the "utils.jar" (which contains our annotation) file
in the geronimo's "lib/endorsed" directory and restart geronimo- (this is no solution but
it makes the problem more clear). So it seems that the geronimo's classloader which is active
at deploy time does not find classes which are included in the EAR file itself and needed
at deploy time.

The same EAR file can be deployed on GlassFish without problems.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message