David Blevins wrote:

The idea is that when having one OpenEJB per-webapp you end up with this:

WEB-INF/lib
WEB-INF/classes
WEB-INF/beans

Where the beans directory holds the EJBs for your web app. So you can pack your ejbs in your war file like other libraries. Really nice for people doing virtual hosting or housing multiple apps for multiple people. OpenEJB and your EJBs are loaded in your webapp's classloader and all the config files are relative to your webapp. Everyone gets their own setup and one bothers anyone else.

Hi Dave,

Not necessarily. The idea of setting OPENEJB_BASE was to *add* to the resources that are in OPENEJB_HOME. It's like in Tomcat where whatever it's in CATALINA_BASE overwrites the counterparts in CATALINA_HOME.

I wonder if people would appreciate if they could configure if OPENEJB_HOME resources should be initialized, too. So, when OPENEJB_BASE/lib exists, no OPENEJB_HOME/lib jars would be touched.

If you threw in something like Derby as an embedded database, you should be 
able to have your own mini-J2EE setup anywhere that offered Tomcat hosting.

So to compare the two ways to use OpenEJB in Tomcat:

SYSTEM = OpenEJB is loaded into Tomcat's common classloader.  All webapps share 
the same EJB instances and have access to all the EJBs deployed in the system.  
There is one openejb.conf for the whole server.  Webapps must not pack the EJB 
classes in their archive.  EJBs cannot see the classes in your WEB-INF/lib and 
WEB-INF/classes directory, shared libraries must be put in Tomcat's common or 
system classloaders to be used by EJBS.

WEBAPP = OpenEJB is loaded into the webapp classloader. Each webapp has it's own openejb.conf, EJBs, and EJB container. No other webapp can affect another's EJBs or EJB container. Webapps must pack the EJB jars in their archive. EJB's can access the libraries in your WEB-INF/classes and WEB-INF/lib directories.

Few minutes ago I added a change so that OPENEJB_BASE behaves as the one in Tomcat.


As stated above, it's also possible to add support for specifing whether the libs in OPENEJB_HOME should be taken into account, too.

A very nice aspect of the one OpenEJB per-webapp is that the EJB's become part 
of your webapp, so when your webapp is deployed/undeployed/redeployed, so are 
your EJBs.  No hocus-pocus required stemming from managing ejbs and servlets 
seperately.

Our existing docs refer the original way to load OpenEJB into Tomcat

I made sure they reflect the current state of art. The OPenEJB-per-webapp was tested against Tomcat 5.5.8-alpha with Java 5.0 whereas OpenEJB was built with Java 1.4. A little mess is to ensure we don't rely on a specific part of the runtime environment.


-David

Jacek



Reply via email to