Hello kapi59ttp,
I have your fixed app right here: http://openejb.org/Opossum.war
When setting the openejb.loader init param to tomcat-webapp, you
effectively embedd OpenEJB and your ejbs into your war file
completely. The result is package that is run entirely in your
webapp space and does not affect any other webapp or the Tomcat
server itself. This does change the layout and classloading concepts
put forth in the traditional style of embedding OpenEJB gloabally
into Tomcat. We call this new concept of app development and
approach to packaging a Collapsed EAR (http://openejb.org/Collapsed+EAR)
We are still working on the documentation for this and are looking
for people to write articles about. It's very exciting.
So here is your app converted to a Collapsed EAR supported by Tomcat
and OpenEJB.
BEFORE:
-------
The OpenEJB Home:
./conf/openejb.conf
./conf/logging.conf
./beans/Opossum.jar
The Webapp:
./WEB-INF/lib/openejb-loader-1.0-beta1.jar
./WEB-INF/web.xml
The Opossum.jar:
./META-INF/ejb-jar.xml
./META-INF/openejb-jar.xml
./ops/opejb/OpossumBean.class
./ops/opejb/OpossumBean.java
./ops/opejb/OpossumClient.class
./ops/opejb/OpossumClient.java
./ops/opejb/OpossumHome.class
./ops/opejb/OpossumHome.java
./ops/opejb/OpossumObject.class
./ops/opejb/OpossumObject.java
AFTER:
------
The Webapp (collapsed ear style):
./META-INF
./META-INF/ejb-jar.xml
./META-INF/log4j.properties
./META-INF/openejb-jar.xml
./META-INF/openejb.xml
./test.jsp
./WEB-INF/classes
./WEB-INF/classes/ops
./WEB-INF/classes/ops/opejb
./WEB-INF/classes/ops/opejb/OpossumBean.class
./WEB-INF/classes/ops/opejb/OpossumBean.java
./WEB-INF/classes/ops/opejb/OpossumClient.class
./WEB-INF/classes/ops/opejb/OpossumClient.java
./WEB-INF/classes/ops/opejb/OpossumHome.class
./WEB-INF/classes/ops/opejb/OpossumHome.java
./WEB-INF/classes/ops/opejb/OpossumObject.class
./WEB-INF/classes/ops/opejb/OpossumObject.java
./WEB-INF/lib
./WEB-INF/lib/geronimo-spec-ejb-2.1-rc4.jar
./WEB-INF/lib/openejb-loader-1.0-beta1.jar
./WEB-INF/web.xml
So what we've done is taken OpenEJB and your EJB jar and overlayed
them right on top of your war file. We have collapsed all the
archives and directories and config files into one unit containing
ejbs and servlets, hence the term Collapsed EAR. The result is one
application containing everything in one archive and one
classloader. Easy and straight-forward. Not need to split things up
and spread them out over several jars and directories. Put your ejb
classes and you servlets in WEB-INF/lib and WEB-INF/classes.
Hope this helps everyone understand this new concept. It's a bit
radical and undocumented, but extremely cool.
So here is a request for feedback from users and potential users.
When I whipped up this stuff I chose to keep the META-INF directory
as not to confuse things too much, however another option that was
attractive to me was to just use the WEB-INF directory for
everything. Using the above setup as an example, that would give us:
POTENTIAL OPTION:
------
The Webapp (collapsed ear style):
./test.jsp
./WEB-INF/classes
./WEB-INF/classes/ops
./WEB-INF/classes/ops/opejb
./WEB-INF/classes/ops/opejb/OpossumBean.class
./WEB-INF/classes/ops/opejb/OpossumBean.java
./WEB-INF/classes/ops/opejb/OpossumClient.class
./WEB-INF/classes/ops/opejb/OpossumClient.java
./WEB-INF/classes/ops/opejb/OpossumHome.class
./WEB-INF/classes/ops/opejb/OpossumHome.java
./WEB-INF/classes/ops/opejb/OpossumObject.class
./WEB-INF/classes/ops/opejb/OpossumObject.java
./WEB-INF/lib
./WEB-INF/lib/geronimo-spec-ejb-2.1-rc4.jar
./WEB-INF/lib/openejb-loader-1.0-beta1.jar
./WEB-INF/log4j.properties
./WEB-INF/openejb-jar.xml
./WEB-INF/openejb.xml
./WEB-INF/ejb-jar.xml
./WEB-INF/web.xml
In this setup, the ejb-jar.xml and web.xml are right next to each
other which gives a more unified feel. What do people think? Which
is better?
Thanks,
David
On Sep 10, 2005, at 7:23 AM, kapi59ttp wrote:
Hi there,
i cannot make OpenEJB and Tomcat work togheter. I am really
stressed :S
I need help, so lets see if anyone can help me. I have followed the
example but i cant make ir work :(
So i describe what i exactly did, and i also attach my files...so lets
se if i can get some help
1. Make an EJB using HelloWorld example and deploy it. It works
fine :D.
Thank you.
2. I make a new context for Tomcat in webapps directory. I have a test
jsp page calle open.jsp.
3. Describe the content of the directory:
/ (with open.jsp)
/ WEB-INF
/classes (empty)
/lib with openejb-loader-1.0-beta1.jar
web.xml (with the adding described on the page)
With this configuration it returns:
/usr/share/tomcat4/work/Standalone/localhost/opossum/open_jsp.java:7:
package ops.opejb does not exist
import ops.opejb.*;
I have tried to copy the deployed Opossum.jar file into WEB-INF/lib
but i cant make it work :S
Any ideas???
Thanks for all :-)
<Opossum.jar>
<web.xml>