David Blevins wrote:
On Thu, Feb 24, 2005 at 02:39:39PM +0100, Jacek Laskowski wrote:
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.
Ok. The original code for openejb.base basicaly treated your base as yours, no inheriting, and used OPENEJB_HOME to find OpenEJB system libraries. The primary motive was avoiding having to copy OpenEJB system libraries all over the place--upgrade hell. In OpenEJB 0.9.2, this is what it does, though I don't think anyone is using it.
It is possible to copy all the lib from OPENEJB_HOME/lib into WEB-INF/lib and just set OPENEJB_HOME to your webapp dir and forget about OPENEJB_BASE.
It seems that having openejb.base aggregate from openejb.home this way implies to people that whatever they put in their webapp (openejb.base) is available just to them and anything in openejb.home is available to all webapps as is the case in a one OpenEJB for all webapps installation. When this isn't the case, the running EJB container is available only to the webapp.
On this note, I'll say we actually could support the scenrio above, e.g. mixing global and per-webapp, but it seems that would really hurt people's brains. Maybe when people get very comfortable with the differences between global and per-webapp rules we might put that in. If we did, we'd either have to come up with new terminology for home/base or change the meaning of home/base.
Anyway, what do users want?
As a user, I don't want to put any system libraries in my web application. Therefore, I think that the simplest thing is just to point openejb.home to $OPENEJB_HOME and be done with it. I don't really see a need for openejb.base if I'm not going to put openejb jars in my WEB-INF/lib. Nor do I ever think that should be done: after all, we do really want to avoid copying jars everywhere.
This leaves the question of bean deployments. What I would like to see is that in the per-webapp scenario, the config loads beans from $OPENEJB_HOME/beans first, and then loads from WEB-INF/beans second. This would be an easy way around the problem of needing a webapp-specific openejb.xml just so you can specify your own local bean directory. Does that make sense? From looking at the source code it seems pretty doable, and I'd be happy to experiminent with it ...
In the container and stand-alone modes, what I'm proposing would not have any effect.
Regards,
Lajos
