geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Multiple Applications within one Ear - Co-dependent classes
Date Wed, 11 Oct 2006 16:29:10 GMT

On Oct 11, 2006, at 10:18 AM, Mark L. wrote:

> Hello,
> I am using Geronimo 1.1.1.  I have created an EAR,  
> ApplicationIntgrations,
> that contains two web modules, WebA and WebB.  Both web modules  
> require
> access to each others classes to be able to run.  WebA depends on  
> classes in
> WebB, and vice versa.  When i deploy the EAR and start the server,  
> i get
> classNotFound errors.  See below.  Class 'test' is a class in WebB,  
> but
> WebA's classloader cannot find him.
> 1:08:49,334 ERROR [[/WebA]] Servlet /WebA threw load() exception
> java.lang.ClassNotFoundException: test in classloader
> Applications/ApplicationIntegrations_WebA.war/EAR/car
> 	at
> org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass 
> (
> 	at java.lang.ClassLoader.loadClass(
> How can i make both web modules' classes visible to each other?  I  
> have
> tried using dependencies and imports, but i am new to Gernoimo and  
> have not
> been able to get either to work.

Since all the classes need to be in the same classloader, you won't  
be able to use dependencies to make this work, as that would lead to  
circular classloader dependencies.  You have to get the classes into  
the ear's classloader: each web app classloader is a child of the ear  

I can think of 3 solutions:

1. Put your classes in jars in appropriate places in the geronimo  
repository and add dependencies to them to the geronimo application  

2. Put the jars in the shared/lib directory and add a dependency to  
the shared lib configuration either in the  geronimo application plan  
or in each web app geronimo plan

3. Include a fake ejb jar (i.e. a jar with an ejb deployment  
descriptor but no ejbs declared) that either contains all the classes  
or uses the manifest classpath to include the jars with the classes.

If you only need a one-way dependency then it would be much easier,  
you could just have one web app depend on the other.

david jencks

> -- 
> View this message in context: 
> Applications-within-one-Ear---Co-dependent-classes- 
> tf2424151.html#a6758567
> Sent from the Apache Geronimo - Users mailing list archive at  

View raw message