QuickTip: Patching up JBoss 4.0.3 sp1 with EJB3

Posted on Thursday, June 19, 2008

0


JBoss provides built-in EJB3 support version 4.2x onwards. For rest of the versions you would need to download the specif JEMSInstaller and patch-in the EJB 3 support.

This is what the JBoss site has to say

Important Note: If you want EJB3 or Seam support with JBoss AS 4.0.3 SP1, 4.0.4 or 4.0.5, you MUST download and use the relevant version of JEMS Installer together with JDK5.0. JBoss AS 4.2.x versions include support for EJB3, by default.

The problem is that when you download the JEMS Installer  for 4.0.3 sp1 and follow the instructions to get the EJB3 support working, it does not work! Your .ear would be deployed but the relevant services to load the EJBs are not started and they are not registered in the JNDI tree.

To get the EJB3 patch onto 4.0.3 sp1 you need to do the following …

Integration of EJB3 into JBoss 4.0.3SP1

(Expanded from http://docs.jboss.com/ejb3/app-server/tutorial/installing.html )
Note: the EJB3 implementation that comes with the JBoss AS 4.0.3SP1 installers needs to be
manually patched. Running the Java installer with an EJB option does *not* work. To perform
the patch, follow the directions below.
Patch JBoss 4.0.3

1. Download JBoss 4.0.3SP1 (java installer version)

2. Run the installer for JBoss 4.0.3SP1

1. Select the ‘all’ Install Type

1. DO NOT select the ‘EJB3” option

2. De-select any “packs” you don’t wish to enable (clustering?)

3. Choose the name of the instance you wish to create

3. Download EJB 3.0 RC6 – PFDi.

1. Unzip this file into a temporary place.

4. Remove from {install home}/server/{instance name}/lib:

1. ejb3-persistence.jar

2. hibernate3.jar

3. hibernate-annotations.jar

4. hibernate-entitymanager.jar

5. Remove from {install home}/server/{instance name}/deploy:

1. Directory jboss-aop.deployer

2. Directory ejb3.deployer (if there is one)

6. Copy from the lib/ directory of the RC6 distribution to {install

home}/server/{instance name}/deploy:

1. Directory ejb3.deployer

2. Directory jboss-aop-jdk50.deployer

3. ejb3-clustered-sfsbcache-service.xml (see note below)

4. ejb3-entity-cache-service.xml (see note below)

5. ejb3-interceptors-aop.xml

7. Copy from the lib/ directory of the RC6 distribution to {install

home}/server/{instance name}/lib:

1. jboss-remoting.jar

2. jboss-serialization.jar

3. jboss-j2ee.jar

4. hibernate3.jar

5. hibernate-annotations.jar

6. hibernate-entitymanager.jar

7. ejb3-persistence.jar

8. javassist.jar

8. To start JBoss for your instance, execute run.sh -c {instance name}

Notes:
1. If you do not want to run JBoss in clustered mode, skip the steps of copying the ejb3-
clustered-sfsbcache-service.xml and the ejb3-entity-cache-service.xml, or
comment out the <mbean> elements in each.
2. As indicated in the [docs.jboss.com] article, client access via the \client libraries is
invalidated with this patch. Follow instructions in the article related to client jars if you
intend to access via a standalone client.
3. Pay particular attention to classloader issues. See the ear-deployer.xml file in \deploy.
The Isolated and CallByValue attributes are both set to true.

Thanks to David Norwood from Red Hat for providing these instructions.

Advertisements
Posted in: Java