geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Problems in configuring dependency on EAR
Date Fri, 08 Jun 2007 15:11:44 GMT

On Jun 8, 2007, at 4:25 AM, Alex Korostov wrote:

> I'm using Geronimo 1.1 and 1.1.1 with Tomcat.
> I have a EAR that includes JARs and a WAR. This application works  
> fine.
> Also I have another (second) WAR application that is NOT included  
> in that
> EAR, but have to use some classes from the JARs and a WAR resided  
> in the
> EAR.
> I declared dependency on this EAR module in the geronimo-web.xml of  
> the
> second WAR. However I got the NoClassDefFoundError exceptions when  
> trying to
> use the classes from EAR's JARs or WAR.
> It looks like that by default, if I create a dependency on EAR I  
> still do
> not have the EAR's classes in the classpath.
> Note, that if I have two WARs (not inside EARs), the same  
> dependency between
> WARs works well. Even classes from the JARs located in the WEB-INF/lib
> folder are accessible for the second WAR.

Since this works I think that you have successfully figured out to  
depend on the deployed module "car" file rather than the undeployed  
war/ear/whatever file.

> What should I do to get the same approach work if I need use  
> classes from
> EAR?

In an ear, we set up one classloader for all the rar and ejb jar  
modules, together with their manifest classpath (I'll call this the  
ear classloader), and one classloader for each war file.  If you have  
a dependency on the ear module you just get the classes in the ear  
classloader.  I don't think it's possible to have a dependency on one  
of the internal war classloaders.  So I think your options are:

- use 2.0-M6 and put all the classes you need in jars in a lib  
directory inside the ear
- use 1.1.1 and add a fake ejb jar that has a deployment descriptor  
but no ejbs.  Either put the classes you need externally in this jar  
or reference the jars in the manifest classpath.

You could also open a jira requesting the ability to depend on wars  
inside ears.

david jencks

> -- 
> View this message in context: 
> configuring-dependency-on-EAR-tf3889208s134.html#a11024722
> Sent from the Apache Geronimo - Users mailing list archive at  

View raw message