Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choosing embedded EJB 3.x container to run Java EE 5 app on Tomcat

I am sorry in advance if my question sounds too generic - I am doing all preliminary research myself but nothing substitutes real experience...

My goal is to port a legacy Java EE application (pre-EJB 3.x) to Tomcat with embedded EJB container. My choices currently stand as follows:

  • JBoss Embeddable EJB
  • Apache OpenEJB
  • OW2 Consortium EasyBeans
  • anything else?

I am expecting to use JMS (with MDBs), Session beans (stateful and stateless), JPA and I am really excited about using JSF with Seam.

Now, given choices above, are there any advantages in using one or another embedded EJB provider?

like image 440
topchef Avatar asked Feb 04 '09 03:02

topchef


People also ask

Can you run an EJB in Tomcat?

Can Tomcat use EJBs? A: The simple answer to this question is no. EJB is part of the larger Java EE platform. As Tomcat only implements the Servlet specification, EJBs cannot be natively hosted within Tomcat.

Does Tomcat support Java EE?

Tomcat isn't Java EE Web Profile compliant either. It lacks inherent support for many useful enterprise development APIs such as CDI, Java Transaction API, JavaServer Faces (JSF), Hibernate and JPA.

Is EJB still used?

EJB is still there and growing up. There are many new features (SOAP/RESTful webservice, JPA entities, JAXB...)


1 Answers

Below are results of my own homework - hopefully someone finds this analysis of embedded EJB providers helpful on deciding if and which container to use.

I went with Apache OpenEJB since it offers rich set of features, partially supports EJB 3.1 and seems as the most active and well rounded-up offering.

As usual, which product should work best for you really depends on your actual requirements, goals, and environment.

Embedded JBoss

  • License: LGPL
  • Java: JDK 5.0
  • Tomcat integration: Yes, modification to server.xml
  • Tomcat Versions: 5.0 and above (?)
  • Deployment to Tomcat: Embedded war
  • List of features: JNDI (local), JBoss TS, JBoss Messaging, JCA, JNDI, EJB, JPA, local TX datasource/connection pool, EJB Security JNDI configuration: overrides Tomcat's JNDI implementation by layering itself on top of Tomcat's JNDI instantiation; Tomcat JNDI is read-only
  • Deployment types: JAR only
  • Management support: No
  • Support: limited, built on top JBoss Microcontainer that is the core of JBoss 5.0, supported option for Seam on Tomcat
  • JMS Provider: same configuration files as JBoss 5.x. JMS is configured in hsqldb-persistence-service.xml, and this can be adjusted to work with other databases
  • XA Connection Pool: No
  • EJB Timer Services: No
  • *Persistence Providers:*Hibernate
  • Limitations: no remote JMS; local interfaces only; local-only JBoss JNDI implementation
  • Documentation: limited
  • EJB 3.1: No

Apache OpenEJB 3.1

  • License: Apache License
  • *Java:*JDK 5.0 or 6.0
  • Tomcat integration:Yes, modifications to startup shell script
  • *Tomcat Versions:*Tomcat 6.x or 5.5
  • *Deployment to Tomcat:*war file
  • *List of features:*EJB 3.0 and 3.1, JTA, JAX-WS, JMS, J2EE Connectors, JPA, JNDI. OpenEJB uses several other open source frameworks such as OpenJPA to provide JPA and CMP persistence, ActiveMQ for JMS/MDB, and Apache CXF for JAX-WS features.
  • *JNDI configuration:*flexible JNDI naming schema
  • *Deployment types:*Collapsed EAR (war), JAR
  • Management support: ActiveMQ JMX mbeans
  • *Support:*Community support, mailing lists and forums, EJB container for Apache Geronimo
  • *JMS Provider:*ActiveMQ
  • *XA Connection Pool:*Yes
  • *EJB Timer Services:*Yes
  • *Persistence Providers:*OpenJPA, Hibernate
  • *Limitations:*OpenEJB uses OpenJPA to provide JPA and CMP persistence, and OpenJPA currently requires a JavaAgent to function properly.
  • *Documentation:*limited but better than others
  • *EJB 3.1:*partial

EasyBeans

  • *License:*LGPL
  • *Java:*JDK 5.0 or 6.0
  • Tomcat integration: Yes
  • *Tomcat Versions:*Tomcat 6.x or 5.5
  • *Deployment to Tomcat:*war file
  • *List of features:*EJB 3.0, JAX-WS, OSGi support
  • JNDI configuration:?
  • *Deployment types:*JAR
  • Management support:?
  • *Support:*Community support and professional support, mailing list, JIRA, EJB container for JOnAS application server
  • JMS Provider:?
  • XA Connection Pool:?
  • *EJB Timer Services:*Yes
  • *Persistence Providers:*OpenJPA, Hibernate, TopLink, EclipseLink
  • Limitations:
  • *Documentation:*limited
  • EJB 3.1: No
like image 61
topchef Avatar answered Sep 21 '22 14:09

topchef