3.2.9. EJB 2.x Changes
3.2.9.1. Update Applications That Use EJB 2.x
JBoss Enterprise Application Platform 6 provides support for EJB 2.x, however, you need to make a few code modifications and start the server with the full profile.
Procedure 3.26. Run EJB 2.x on JBoss Enterprise Application Platform 6
Modify the Code to Use the New JNDI Namespace Rules
As with EJB 3.0, you must use the full JNDI prefix with EJB 2.x. For more information on the new JNDI namespace rules and code examples, see Section 3.1.8.1, “Update Application JNDI Namespace Names”.Examples showing how to update JNDI namespaces from previous releases can be found here: Section 3.1.8.5, “Examples of JNDI Namespaces in Previous Releases and How They are Specified in JBoss Enterprise Application Platform 6”.Replace JBoss AOP Interceptors
JBoss AOP (Aspect Oriented Programming) is no longer included in JBoss Enterprise Application Platform 6. In previous releases, JBoss AOP was used by the EJB container. However, in JBoss Enterprise Application Platform 6, the EJB container uses a new mechanism. If your application uses JBoss AOP, you need modify your application code as follows.- Standard EJB3 configurations that were made in the
ejb3-interceptors-aop.xml
file are now done in the server configuration file. For a standalone server, this is thestandalone/configuration/standalone-full.xml
file. If you are running your server in a managed domain, this is thedomain/configuration/domain.xml
file. - Applications that integrate AOP interceptors into the EJB layer must be redesigned to use EJB3 interceptors and CDI. Server side interceptors can be changed to EJB3 interceptors.
Modify the
jboss-web.xml
File DescriptorModify the<jndi-name>
for each<ejb-ref>
to use the new JNDI fully qualified lookup format.Replace the
jboss.xml
deployment descriptor fileThejboss-ejb3.xml
deployment descriptor replaces thejboss.xml
deployment descriptor to override and add to the features provided by the Java Enterprise Edition (EE) definedejb-jar.xml
deployment descriptor. The new file is incompatible withjboss.xml
, and thejboss.xml
is now ignored in deployments.Start the Server with the Full Profiles
EJB 2.x requires the Java Enterprise Edition 6 Full Profile. To start JBoss Enterprise Application Platform 6 with the full profile, pass the argument-c standalone-full.xml
on the command line when you start the server.