Wednesday, January 23, 2008

New features in EJB 3.1 : Article on

Reza Rahman, co-author of the book "EJB3 in Action", has an article in which gives a preview of the next version of Java EE spec EJB 3.1.

You can read the article here:
1. New features in 3.1

The ones I am interested are:

1. Support for stateful web services via Stateful Session Bean web service endpoints.
2. The standardization of JNDI mapping. I had to workaround a solution for testing on 3 different application servers, JBoss, Oracle and GlassFish. Each of them have completely different naming convention for the Remote Interfaces.

The GlassFish AS uses the fully qualified name of the remote business interface as default.
Object obj = initialContext.lookup("com.os.ent.CustomerManagerRemote");

JBoss on the other hand uses the Application Name, followed by the EJB name and followed by /remoteconstant.
Object obj = initialContext.lookup("ejb3sampleapp/CustomerManager/remote");

Oracle, uses the name specified in the @Stateless annotation.
Object obj = initialContext.lookup("CustomerManager");

What new features are you looking forward in the coming version?


  1. I like the Singleton Beans and also making the Session Bean business interfaces optional.

  2. Pretty interesting features out there.

  3. I'm looking forward to the updated EJB Timer service, being able to put EJBs inside of .war files alongside your web app code, singleton EJBs that get events when app server starts/stops, stateful EJB service endpoints, ... well I guess I love everything being done to EJBs. I really hope they improve dependency injection to the level of what Spring can do.

  4. I completely agree with you about dependency injection. I haven't used Timer service in this version though.