Overview

Servers

Integrations

Community

Related Projects

Index

Feeds

 

  • Release Date: September 29th, 2007
  • EJB 3.0 support
  • EJB 2.1 support
  • EJB 2.0 support
  • EJB 1.1 support

Download

OpenEJB Standlone Server

OpenEJB for Tomcat

EJB 3.0 and other examples (source included)

Source Code

Tested On

  Windows XP
(Sun JDK 1.5)
Windows XP
(Sun JDK 1.6)
Linux
(Sun JDK 1.5)
Mac OSX
(Apple JDK 1.5)
Mac OSX
(Apple JDK 1.6)
Embedded
Standalone
Tomcat 6.0.14
Tomcat 6.0.13
Tomcat 6.0.10
Tomcat 6.0.9

New Features

EJB 3.0

OpenEJB 3.0 supports the EJB 3.0 specification as well as the prior EJB 2.1, EJB 2.0, and EJB 1.1. New features in EJB 3.0 include:

  • Annotations instead of xml
  • No home interfaces
  • Business Interfaces
  • Dependency Injection
  • Intercpetors
  • Java Persistence API
  • Service Locator (ala SessionContext.lookup)
  • POJO-style beans

EJB 2.x features since OpenEJB 1.0 also include:

  • MessageDriven Beans
  • Container-Managed Persistence (CMP) 2.0
  • Timers

The two aspects of EJB that OpenEJB does not yet support are:

  • Web Services (JAX-WS, JAX-RPC)
  • CORBA

JAX-WS and CORBA support will be added in future releases. Support for the JAX-RPC API is not a planned feature.

EJB Plugin for Tomcat 6

OpenEJB 3.0 can be plugged into any Tomcat 6 server, adding support for EJBs in Web Apps. War files themselves can contain EJBs and the Servlets can use new JavaEE 5 annotations, XA transactions, JPA, and JMS. Webapps can even support fat java clients connecting over HTTP.

CMP via JPA

Our CMP implementation is a thin layer over the new Java Persistence API (JPA). This means when you deploy an old style CMP 1.1 or CMP 2.1 bean it is internally converted and ran as a JPA bean. This makes it possible to use both CMP and JPA in the same application without any coherence issues that can come from using two competing persistence technologies against the same data. Everything is ultimately JPA in the end.

Extended Dependency Injection

Dependency Injection in EJB 3.0 via @Resource is largely limited to objects provided by the container, such as DataSources, JMS Topics and Queues. It is possible for you to supply your own configuration information for injection, but standard rules allow for only data of type String, Character, Boolean, Integer, Short, Long, Double, Float and Byte. If you needed a URL, for example, you'd have to have it injected as a String then convert it yourself to a URL. This is just plain silly as the conversion of Strings to other basic data types has existed in JavaBeans long before Enterprise JavaBeans existed.

OpenEJB 3.0 supports injection of any data type for which you can supply a JavaBeans PropertyEditor. We include several built-in PropertyEditors already such as Date, InetAddress, Class, File, URL, URI, Map, List and more.

MyBean.java
import java.net.URI;
import java.io.File;
import java.util.Date;

@Stateful 
public class MyBean {
    @Resource URI blog;
    @Resource Date birthday;
    @Resource File homeDirectory;
}

The META-INF/env-entries.properties

Along the lines of injection, one of the last remaining things in EJB 3 that people need an ejb-jar.xml file for is to supply the value of env-entries. Env Entries are the source of data for all user supplied data injected into your bean; the afore mentioned String, Boolean, Integer, etc. This is a very big burden as each env-entry is going to cost you 5 lines of xml and the complication of having to figure out how to add you bean declaration in xml as an override of an existing bean and not accidentally as a new bean. All this can be very painful when all you want is to supply the value of a few @Resource String fields in you bean class.

To fix this, OpenEJB supports the idea of a META-INF/env-entries.properties file where we will look for the value of things that need injection that are not container controlled resources (i.e. datasources and things of that nature). You can configure you ejbs via a properties file and skip the need for an ejb-jar.xml and it's 5 lines per property madness.

META-INF/env-entries.properties
blog = http://acme.org/myblog
birthday = locale=en_US style=MEDIUM Mar 1, 1954
homeDirectory = /home/esmith/

Support for GlassFish descriptors

Unit testing EJBs with OpenEJB is a major feature and draw for people, even for people who may still use other app servers for final deployment such as Geronimo or GlassFish. The descriptor format for Geronimo is natively understood by OpenEJB as OpenEJB is the EJB Container provider for Geronimo. However, OpenEJB also supports the GlassFish descriptors so people using GlassFish as their final server can still use OpenEJB for testing EJBs via plain JUnit tests in their build and only have one set of vendor descriptors to maintain.

JavaEE 5 EAR and Application Client support

JavaEE 5 EARs and Application Clients can be deployed in addition to ejb jars. EAR support is limited to ejbs, application clients, and libraries; WAR files and RAR files will be ignored. Per the JavaEE 5 spec, the META-INF/application.xml and META-INF/application-client.xml files are optional.

Application Validation for EJB 3.0

Incorrect usage of various new aspects of EJB 3.0 are checked for and reported during the deployment process preventing strange errors and failures.

As usual validation failures (non-compliant issues with your application) are printed out in complier-style "all-at-once" output allowing you to see and fix all your issues in one go. For example, if you have 10 @PersistenceContext annotations that reference an invalid persistence unit, you get all 10 errors on the first deploy rather than one failure on the first deploy with 9 more failed deployments to go.

Validation output comes in three levels. The most verbose level will tell you in detail what you did wrong, what the options are, and what to do next... even including valid code and annotation usage tailored to your app that you can copy and paste into your application. Very ideal for beginners and people using OpenEJB in a classroom setting.

JNDI Name Formatting

A complication when using EJB is that plain client applications are at the mercy of vendor's chosen methodology for how JNDI names should be constructed. OpenEJB breaks the mold by allowing you to specify the exact format you'd like OpenEJB to use for your server or any individual application. Supply us with a formatting string, such as "ejb/{ejbName}/{interfaceClass.simpleName}", to get a JNDI layout that best matches your needs.

Changelog

New Features:

issues.apache.org  (16 issues) 
Key Summary
OPENEJB-690 Hot deploy and undeploy via command line tool
OPENEJB-689 Enterprise JavaBeans 3.0 support
OPENEJB-606 Commons DBCP Managed Data Sources
OPENEJB-458 META-INF/env-entries.properties
OPENEJB-451 openejb.xml to properties converter
OPENEJB-304 EAR Deployment support for EJBs and AppClients
OPENEJB-261 Embedded EJB Container for Unit Tests
OPENEJB-260 Automatic Configuration for Simple Apps
OPENEJB-216 Annotation-based Deployment
OPENEJB-132 New Tomcat/OpenEJB integration
OPENEJB-128 EJBd over HTTP -- ejb invocations over http protocol
OPENEJB-123 CMP 2.x support via JPA
OPENEJB-98 Dependency Injection
OPENEJB-90 Business Interface support
OPENEJB-89 EJB 2.1 <-> 3.0 compatibility
OPENEJB-79 Interceptors

Improvements:

issues.apache.org  (12 issues) 
Key Summary
OPENEJB-414 ActiveMQ Broker ServerService
OPENEJB-692 JAAS and JACC Security
OPENEJB-691 Adaptive logging for embedded and standalone modes
OPENEJB-389 Deployment support for EJB jar files without ejb-jar.xml files
OPENEJB-561 Stateless and Stateful pools on a per ejb basis
OPENEJB-429 Support for Network servlces while Embedded
OPENEJB-425 Support for JPA runtime class enhancement
OPENEJB-573 Support for JSR-77 j2ee management MEJB
OPENEJB-47 Support for common Exceptions serialization issues
OPENEJB-452 Support for partially complete openejb-jar.xml files
OPENEJB-337 Derby Network Service
OPENEJB-336 Derby support

Tasks & Sub-Tasks:

issues.apache.org  (147 issues) 
Key Summary
OPENEJB-591 "Hungry Exception" cleanup.
OPENEJB-523 @Remove invocation on home.remove or remote.remove
OPENEJB-398 @Stateless and @Stateful EJB 3 support
OPENEJB-447 Ability for remote server to pickup new deployments as they are added
OPENEJB-675 Add support for logging being configured externally
OPENEJB-605 Allow more info in authentication request
OPENEJB-427 Allow multiple URIs in the ServerMetaData object to provide for clustering
OPENEJB-446 App undeploy
OPENEJB-130 Automated Tomcat testing on Mac OSX and Linux
OPENEJB-78 Business Method: AroundInvoke
OPENEJB-416 CMP2JPA: CMP 1.x beans
OPENEJB-417 CMP2JPA: CMP 2.x cmp-fields
OPENEJB-421 CMP2JPA: CMP 2.x ejbSelect
OPENEJB-420 CMP2JPA: CMP 2.x many-to-many
OPENEJB-419 CMP2JPA: CMP 2.x one-to-many
OPENEJB-418 CMP2JPA: CMP 2.x one-to-one
OPENEJB-541 CMP2JPA: Complex Primary Key
OPENEJB-415 CMP2JPA: Create JPA based CMP container based on Castor container
OPENEJB-422 CMP2JPA: Generate CMP 2.x concrete class for JPA
OPENEJB-424 CMP2JPA: Generate entity-mapping.xml using OpenEJB 2.x openejb-jar.xml file
OPENEJB-423 CMP2JPA: Generate entity-mapping.xml using ejb-jar.xml file
OPENEJB-542 CMP2JPA: Unknown Primary Key
OPENEJB-87 Class-level Interceptors
OPENEJB-108 Create javax.ejb classes, interfaces, enums, and annotations
OPENEJB-109 Create javax.persistence classes, interfaces, enums and annotations
OPENEJB-99 Dependency Injection: Public field
OPENEJB-100 Dependency Injection: Setter
OPENEJB-520 EJB 3 Pojo Session beans with EJB 2.1 Home and Remote interfaces
OPENEJB-521 EJB 3 Pojo Session beans with EJB 2.1 LocalHome and Local interfaces
OPENEJB-522 EJB 3 Stateful beans with init-method/@Init
OPENEJB-406 EJB3 equals() and hashCode() support for business interface proxies
OPENEJB-369 EJBContext.getTimerService()
OPENEJB-368 EJBContext.lookup
OPENEJB-404 EJBHome.create<METHOD> style invoke
OPENEJB-380 ENC: message-destination-ref: javax.jms.Queue
OPENEJB-381 ENC: message-destination-ref: javax.jms.Topic
OPENEJB-382 ENC: persistence-context-ref
OPENEJB-383 ENC: persistence-unit-ref
OPENEJB-377 ENC: resource-env-ref: javax.ejb.SessionContext
OPENEJB-378 ENC: resource-env-ref: javax.jms.Queue
OPENEJB-379 ENC: resource-env-ref: javax.jms.Topic
OPENEJB-374 ENC: resource-ref: java.net.URL
OPENEJB-375 ENC: resource-ref: javax.jms.QueueConnectionFactory
OPENEJB-376 ENC: resource-ref: javax.jms.TopicConnectionFactory
OPENEJB-373 ENC: resource-ref: javax.mail.Session
OPENEJB-405 EntityBean.ejbHome<METHOD> method support
OPENEJB-356 Example: @Resource for Setter Injection
OPENEJB-347 Example: Minimal Stateful Bean via @Stateful
OPENEJB-346 Example: Minimal Statetless Bean via @Stateless
OPENEJB-357 Example: Using @EJB to refer to other EJBs
OPENEJB-83 Expand protocol for non-ejb specific interfaces
OPENEJB-624 Extract Logger Categories to a separate interface
OPENEJB-96 Global JNDI Business Interface references
OPENEJB-610 Hot deploy tool
OPENEJB-102 Injection of EJB References
OPENEJB-101 Injection of Environment Entries
OPENEJB-105 Injection of Message Destination References
OPENEJB-107 Injection of Persistence Context References
OPENEJB-106 Injection of Persistence Unit References
OPENEJB-104 Injection of Resource Environment References
OPENEJB-103 Injection of Resource Manager Connection Factory References
OPENEJB-544 Interceptor Chain
OPENEJB-214 Interceptor: Lifecycle Callbacks: PostActivate/PrePassivate
OPENEJB-80 InvocationContext
OPENEJB-543 InvocationContext
OPENEJB-95 JNDI ENC Business Interface references
OPENEJB-77 Lifecycle Callbacks: PostActivate/PrePassivate
OPENEJB-76 Lifecycle Callbacks: PostConstruct/PreDestroy
OPENEJB-93 Local business interfaces via IntraVM Server
OPENEJB-308 META-INF/lib or APP-INF/lib for third-party jars in EARs
OPENEJB-532 MessageDriven "onMessage" Interception
OPENEJB-211 MessageDriven Bean: Lifecycle Callbacks: PostConstruct/PreDestroy
OPENEJB-533 MessageDriven Lifecycle Interception
OPENEJB-88 Method-level Interceptors
OPENEJB-85 Non-EJBLocalObject local proxies for in-vm use
OPENEJB-84 Non-EJBObject remote proxies for in-vm use
OPENEJB-86 Package-level Interceptors (aka Default Interceptors)
OPENEJB-119 Port BMP Container
OPENEJB-121 Port MDB Container
OPENEJB-118 Port Stateful Container
OPENEJB-117 Port Stateless Container
OPENEJB-627 Refactor Logging API to tighten Logger creation
OPENEJB-91 Remote business interfaces via EJBd Server
OPENEJB-92 Remote business interfaces via IntraVM Server
OPENEJB-94 SessionContext.getBusinessObject(interface)
OPENEJB-97 SessionContext.getInvokedBusinessInterface
OPENEJB-213 Stateful Bean: Lifecycle Callbacks: PostActivate/PrePassivate
OPENEJB-210 Stateful Bean: Lifecycle Callbacks: PostConstruct/PreDestroy
OPENEJB-530 Stateful Business Method Interception
OPENEJB-531 Stateful Lifecycle Interception
OPENEJB-442 Stateful Session Bean Extended Persistence Context
OPENEJB-209 Stateless Bean: Lifecycle Callbacks: PostConstruct/PreDestroy
OPENEJB-529 Stateless Business Method Interception
OPENEJB-528 Stateless Lifecycle Interception
OPENEJB-558 Upgrade ActiveMQ to 4.1.1
OPENEJB-265 Upgrade XBean to 2.6
OPENEJB-686 Use released openjpa 1.0.0
OPENEJB-536 Validation: AroundInvoke signature
OPENEJB-526 Validation: Check for incorrect use of injection-target-name
OPENEJB-455 Validation: Check that @Local hasn't been used to point to an EJBLocalHome or EJBLocalObject interface
OPENEJB-454 Validation: Check that @Remote hasn't been used to point to an EJBHome or EJBObject interface
OPENEJB-552 Validation: EjbName used in InterceptorBinding is correct
OPENEJB-612 Validation: EjbName used in method-based InterceptorBinding
OPENEJB-616 Validation: PostActivate callback signature is correct
OPENEJB-614 Validation: PostConstruct callback signature is correct
OPENEJB-613 Validation: PreDestroy callback signature is correct
OPENEJB-615 Validation: PrePassivate callback signature is correct
OPENEJB-617 Validation: Warn on unsupported service-refs
OPENEJB-575 Validation: XML method permissions to beans that do not exist
OPENEJB-574 Validation: XML transaction attributes to beans that do not exist
OPENEJB-212 interceptor: Lifecycle Callbacks: PostConstruct/PreDestroy
OPENEJB-221 javax.annotation.PostConstruct
OPENEJB-222 javax.annotation.PreDestroy
OPENEJB-603 javax.annotation.Resource: for SessionContext
OPENEJB-602 javax.annotation.Resource: for TimerService
OPENEJB-223 javax.annotation.Resource: for env-entry
OPENEJB-401 javax.annotation.Resource: for message-destination-ref
OPENEJB-400 javax.annotation.Resource: for resource-ref
OPENEJB-224 javax.annotation.Resources
OPENEJB-225 javax.annotation.security.DeclareRoles
OPENEJB-226 javax.annotation.security.DenyAll
OPENEJB-227 javax.annotation.security.PermitAll
OPENEJB-228 javax.annotation.security.RolesAllowed
OPENEJB-229 javax.annotation.security.RunAs
OPENEJB-230 javax.ejb.ActivationConfigProperty
OPENEJB-231 javax.ejb.ApplicationException
OPENEJB-232 javax.ejb.EJB
OPENEJB-233 javax.ejb.EJBs
OPENEJB-234 javax.ejb.Init
OPENEJB-235 javax.ejb.Local
OPENEJB-236 javax.ejb.LocalHome
OPENEJB-237 javax.ejb.MessageDriven
OPENEJB-238 javax.ejb.PostActivate
OPENEJB-239 javax.ejb.PrePassivate
OPENEJB-240 javax.ejb.Remote
OPENEJB-241 javax.ejb.RemoteHome
OPENEJB-242 javax.ejb.Remove
OPENEJB-243 javax.ejb.Stateful
OPENEJB-244 javax.ejb.Stateless
OPENEJB-245 javax.ejb.Timeout
OPENEJB-246 javax.ejb.TransactionAttribute
OPENEJB-247 javax.ejb.TransactionManagement
OPENEJB-248 javax.interceptor.AroundInvoke
OPENEJB-249 javax.interceptor.ExcludeClassInterceptors
OPENEJB-250 javax.interceptor.ExcludeDefaultInterceptors
OPENEJB-251 javax.interceptor.Interceptors
OPENEJB-441 javax.transaction.TransactionSynchronizationRegistry

Unimplemented Features, bugs, limitations

issues.apache.org  (11 issues) 
Key Summary
OPENEJB-971 <messaging-type> should default to javax.jms.MessageListener for EJB 2.1 and prior descriptors
OPENEJB-731 Validation: JTA EntityManager refers to RESOURCE_LOCAL persistence-unit
OPENEJB-550 Need to support persistent TimerStore
OPENEJB-628 Unenhanced JPA support with OpenJPA
OPENEJB-959 Check for user supplied connection information in persistence-units and warn
OPENEJB-802 Support for IBM JDK 1.5
OPENEJB-1331 Global, app, or module jndi contexts are not always linked with ejb's jndi context
OPENEJB-621 Allow properties command to work securely to fully remote servers
OPENEJB-611 Hot deploy directory
OPENEJB-696 Error occured. Thread-8: Thread-8 upon stopping the server via telnet console
OPENEJB-932 Global PersistenceUnits available to all apps

   

Apache OpenEJB is an project of The Apache Software Foundation (ASF)
Site Powered by Atlassian Confluence .
[ edit ]