You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by freeway <fw...@qad.com> on 2010/03/25 15:37:41 UTC

Webapp startup order in Tomcat with OpenEJB

I have noticed that, when installing embedded OpenEJB along with application
webapps into a new Tomcat environment, sometimes OpenEJB is not started
first at Tomcat startup.  When this happens, the other webapps (which
contain EJBs or other objects that require OpenEJB support) raise fatal
errors on startup, because they cannot find OpenEJB's JNDI context. 

In most of our test environments this does not seem to be a problem, and
sometimes the problem has mysteriously corrected itself.  However, is there
some configuration I can use to guarantee that OpenEJB will be started first
by Tomcat?  I understand that neither Tomcat nor the Servlet spec allow any
particular order to be specified for webapp start, but does OpenEJB provide
some way to guarantee this? 

One more point: I think the ordering problem may only be occurring in Tomcat
5.5 environments rather than Tomcat 6, although that point may be a
coincidence. 


Regards, 
Fred 
-- 
View this message in context: http://n4.nabble.com/Webapp-startup-order-in-Tomcat-with-OpenEJB-tp1690744p1690744.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Webapp startup order in Tomcat with OpenEJB

Posted by freeway <fw...@qad.com>.
Hi Jean-Louis,

I think you are correct that this is an installation problem.  However,
after some testing today I have found what I think are several problems, one
expected and one not.

BTW, I am using OpenEJB 3.1.2 with Tomcat 5.5 on Linux at the moment.

The first problem is that our OpenEJB webapp had been renamed from
openejb.war to use a prefix that reflects our own naming conventions,
whereas the OpenEJB web site states that the WAR name must be 'openejb.war'. 
When the wrong name was used, I found that when all our WARs including
OpenEJB were first deployed, startup errors were raised because the webapp
load order was wrong.

After fixing this problem to use the correct 'openejb.war' name, the initial
deployment and startup of the WARs worked fine.  However, when Tomcat was
restarted with no new webapp deployments or changes, the problem returned. 
Once again, OpenEJB was not loaded first and JNDI errors were raised in the
other webapps.

Next, I tried installing the OpenEJB listener and JavaAgent from the OpenEJB
webapp page.  (This step is documented on the OpenEJB web site as no longer
necessary in Tomcat 5.5 or 6 environments.)  So far, it seems to have fixed
the webapp loading problem entirely.

I will continue testing our Tomcat deployment-startup process, but wanted to
ask you a couple of questions about it.

1) Do my test results regarding the incorrect openejb.war filename make
sense, based on how the OpenEJB load process works?  Or have I misunderstood
the behavior somehow?

2) Is installing the OpenEJB listener still necessary, despite what the
documentation says?  Or is it necessary in Tomcat 5.5 but not Tomcat 6? 
(Because Tomcat 5.5 and 6 classloading are different, this seems possible.)


Thanks for your prompt response!

Fred

-- 
View this message in context: http://n4.nabble.com/Webapp-startup-order-in-Tomcat-with-OpenEJB-tp1690744p1691554.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Webapp startup order in Tomcat with OpenEJB

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi Fred,

The o.a.o.tomcat.loader.OpenEJBListener is responsible for finding the
openejb webapp and bootraspping the container before any other webapp.

So if OpenEJB is not the first webapp loader, may be OpenEJB is not well
installed.

Can you have a look?

Jean-Louis



freeway wrote:
> 
> I have noticed that, when installing embedded OpenEJB along with
> application webapps into a new Tomcat environment, sometimes OpenEJB is
> not started first at Tomcat startup.  When this happens, the other webapps
> (which contain EJBs or other objects that require OpenEJB support) raise
> fatal errors on startup, because they cannot find OpenEJB's JNDI context. 
> 
> In most of our test environments this does not seem to be a problem, and
> sometimes the problem has mysteriously corrected itself.  However, is
> there some configuration I can use to guarantee that OpenEJB will be
> started first by Tomcat?  I understand that neither Tomcat nor the Servlet
> spec allow any particular order to be specified for webapp start, but does
> OpenEJB provide some way to guarantee this? 
> 
> One more point: I think the ordering problem may only be occurring in
> Tomcat 5.5 environments rather than Tomcat 6, although that point may be a
> coincidence. 
> 
> 
> Regards, 
> Fred 
> 

-- 
View this message in context: http://n4.nabble.com/Webapp-startup-order-in-Tomcat-with-OpenEJB-tp1690744p1690814.html
Sent from the OpenEJB User mailing list archive at Nabble.com.