3.2.9. EJB 2.x Changes
126.96.36.199. Update Applications That Use EJB 2.x
Procedure 3.26. Run EJB 2.x on JBoss Enterprise Application Platform 6
Modify the Code to Use the New JNDI Namespace RulesAs 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 188.8.131.52, “Update Application JNDI Namespace Names”.Examples showing how to update JNDI namespaces from previous releases can be found here: Section 184.108.40.206, “Examples of JNDI Namespaces in Previous Releases and How They are Specified in JBoss Enterprise Application Platform 6”.
Replace JBoss AOP InterceptorsJBoss 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.xmlfile are now done in the server configuration file. For a standalone server, this is the
standalone/configuration/standalone-full.xmlfile. If you are running your server in a managed domain, this is the
- 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.
jboss-web.xmlFile DescriptorModify the
<ejb-ref>to use the new JNDI fully qualified lookup format.
jboss.xmldeployment descriptor fileThe
jboss-ejb3.xmldeployment descriptor replaces the
jboss.xmldeployment descriptor to override and add to the features provided by the Java Enterprise Edition (EE) defined
ejb-jar.xmldeployment descriptor. The new file is incompatible with
jboss.xml, and the
jboss.xmlis now ignored in deployments.
Start the Server with the Full ProfilesEJB 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.xmlon the command line when you start the server.