Integration is loaded through this line in conf/server.xml :
<Listener className="org.apache.tomee.loader.OpenEJBListener" />
This happens immediately upon launch, before launching any applications. Libraries from the <tomcat-home>/webapps/openejb/lib are added to the Tomcat class loader, another listener is installed to participate in the deployment, and from now on, everything happens using events in the Tomcat life cycle. Tomcat emits several events when the application starts (deploys) and shuts down. Tomcat itself uses them to deploy servlets, and essentially integration is something more. Other sellers who include Tomcat also use these hooks. From this point of view, the integration is really quite boring :)
The only interesting twist is the addition of additional libraries to the war file. This is really only done to deliver and add additional libraries to your existing Tomcat installation as simple as possible (and as simple as possible to remove). All libraries from <tomcat-home>/webapps/openejb/lib can just as easily go to <tomcat-home>/lib . At this point, the only thing that may be required for the webapss/openejb/ war is the ability to invoke EJB via HTTP.
So the short answers are:
- The order in which the application starts is irrelevant.
- EJB deployment happens side by side with servlet deployment
- Boxes are added to the System Tomcat class loader immediately after starting Tomcat
It is interesting to note that in another answer, Tomcat actually only launches two banks on the class path. Tomcat itself actually adds all banks from <tomcat-home>/lib/ automatically at startup. We basically do the same thing, only from <tomcat-home>/webapps/openejb/lib
I donβt think that we really tested moving the libraries to <tomcat-home>/lib/ and removing openejb webapp (which is called tomee.war in the next final version), but I will take a note to try this. It seems that itβs good to maintain or even do it by default. You can remove Tomcat manager and ROOT webapps, so it seems like a good idea to simplify uninstalling openejb.war.
David blevins
source share