tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: question about using openEJB+tomcat with ear file
Date Sat, 12 Sep 2009 02:38:13 GMT

On Sep 5, 2009, at 9:31 AM, Mho wrote:

> To demonstrate this problem I have created a simple ear file that  
> looks like
> this:
> ext is a web app with a servlet "Agent" that just tries to talk to a  
> session
> bean that is in an EJB called "service".
> So I load up the ext.war file and also aif6.ear file in Tomcat and  
> restart
> Tomcat.
> ( Note: I need to load the war file separately because Catalina  
> looks for
> the document root for web app in /ext. Naturally when the EAR file is
> expanded the document root is in /aif6/ext and Catalina throws an  
> exception
> saying it cant find the web app. To make it happy I have to put the  
> war file
> in the webapp directory. -- that is another problem that I will have  
> to fix
> -- I am not sure this is related to the problem I am asking about in  
> this
> email if anyone has a suggestion I will be grateful)

I think loading up the webapp separately is causing the problem.   
Timing the loading of a separate webapp that has a reference to an ejb  
jar inside a separate ear is not something that will be reliable.    
The concept of the ear is that all the items are inside the ear and  
that's how ordering is guaranteed.

All is not lost, however, there is a far easier approach.  OpenEJB  
supports putting ejb jar files *inside* the war file under WEB-INF/ 
lib/ or ejb classes under WEB-INF/classes/, more or less turning the  
war as a sort of ear file.  We call this Collapsed EAR:

Note where it says in that document "Not quite J2EE", that is actually  
changing.  This functionality of OpenEJB is being added to the EJB 3.1  
specification along with the Embedded EJB Container support that  
OpenEJB does.  So putting ejbs inside a war file will be a standard  
thing in Java EE 6.

Hope that helps!


View raw message