geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan (JIRA)" <>
Subject [jira] Commented: (GERONIMO-4618) ClassNotFoundException for annotations defined in JAR files an used in EJB's deployed within an EAR
Date Thu, 21 May 2009 10:53:45 GMT


Ivan commented on GERONIMO-4618:

Hi, Frank:
     Is the util.jar an simple jar file ? If it is, could you please try to put it in the
lib folder of your ear package, there should be the right place to hold those util jars for
each module in the EAR package. 

> ClassNotFoundException for annotations defined in JAR files an used in EJB's deployed
within an EAR
> ---------------------------------------------------------------------------------------------------
>                 Key: GERONIMO-4618
>                 URL:
>             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:
> EAR/
>   |--- ejbs.jar
>   |---lib/
>          | ---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(
>         at
>         at
> Caused by: java.lang.ClassNotFoundException: a.b.c.OurAnnotation
>         at$
>         at Method)
>         at
>         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