You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "vlad.balan" <vl...@gmail.com> on 2011/03/02 19:08:56 UTC
Web applications and EJBs
I set up the example "webapps/ejb-examples" in Eclipse in a Dynamic
WebApplication project:
- installed the tomcat6+openejb distribution of openejb
- copied the original sources to the project's sources
- added as a copile-time library (a so called "user-defined" library)
containing all the jars from embedded OpenEjb distribution so that there
were no compilation errors.
- created a server runtime for Tomcat 6 and deployed my web app on it.
- corrected a few errors in the code: in web.xml "Transaction" instead of
"Transactional"; in persistence.xml changed to (after looking in
tomcat_install/conf/openejb.xml for the actual data source declarations
sections):
java:openejb/Resource/My DataSource
java:openejb/Resource/My Unmanaged DataSource
instead of what was there before.
OK, so the problem is that EJBs (that live in WEB-INF/classes because they
where originally in the sources with all other classes: servlets, etc.) are
not seen.
Even if i added a WEb-INF/classes/META-INF/ejb-jar.xml.
What i had to do to be seen was:
- create a separate java project and but the ejb classes there (and add the
dependency to the openejb user libabry described above).
- add that separate project as J2EE Module dependency to the WebApplication
project through Eclipse's "Properties/Java EE Module Dependecies" dialog.
This ensures in fact that the Java project, called let's say
"my-ejbs-examples-ejbs" ends up as "my-ejbs-examples-ejbs.jar" in
WEB-INF/lib
Only like this, its was picked up by OpenEJB of Tomcat.
Is it normal to not see ejbs in WEB-INF/classes?
--
View this message in context: http://openejb.979440.n4.nabble.com/Web-applications-and-EJBs-tp3331982p3331982.html
Sent from the OpenEJB User mailing list archive at Nabble.com.