Welcome!

Java Authors: Carmen Gonzalez, Pat Romanski, Imran Akbar, Sharon Barkai, Adrian Bridgwater

Related Topics: Java, Apache

Java: Article

Developing EJB 3 Applications in Apache Tomcat Using Apache OpenEJB

Beyond unit testing

OpenEJB has been around for seven years and is one of the few standalone and embeddable EJB containers. Useful mainly for unit testing EJB beans (embedding the containers in unit tests), OpenEJB is also available as a Tomcat plug-in. Which means you can call EJB beans from your Web application's servlets. This fact alone opens up new possibilities for migrating current Web applications to JEE 5 in addition to facilitating development and testing using the popular Apache Tomcat server instead of a full JEE application server, even if you eventually deploy to a dedicated JEE application server. OpenEJB 3 supports JPA out-of-the-box (and CMP by mapping to JPA) and uses the Apache OpenJPA implementation. JMS support is also included in ActiveMQ and recently Web Services annotation support has been added to hook up with a Web service provider like Axis2. There's built-in database support via hsqldb but it's easy to configure any database server via the conf/openejb.xml configuration file.

OpenEJB was started by David Blevins and Richard Monson-Haefel and initially supported EJB 1.1 and part of the EJB 2 specification. In 2006 OpenEJB 1.0 was released completing this initial 0.9.2 "branch," while work continued on the EJB 3 version targeting EJB 3. A couple of the OpenEJB 1.0 features became casualties as a result of changes required to support the move from Geronimo 1.0 to 2.0 (the OpenEJB 2.0 internal equivalent), so the team went back to the add embeddability as well as Tomcat plugability recently, upgrading the 1.0 release to a OpenEJB 3.0 beta release while graduating from Apache incubation. Despite the beta status, the OpenEJB 3 container is certified via Geronimo 2.0's JEE 5 certification back in June, making it usable in production environments as a standalone server. What's new and what I'll go into detail here is the Tomcat plug-in. Currently OpenEJB 3.0 supports only Tomcat 6.x but support for Tomcat 5.5 is being added.

More Stories By Dario Laverde

Dario Laverde is a Java architect, lecturer, author, and JUG leader. He has been developing in Java since 1995.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.