WAR calling EJB (RMI) between JBoss EAP 5.x and JBoss EAP 4.x
Environment
- JBoss Enterprise Application Platform (EAP)
- 5.x
- 4.x
Issue
- Expereincing problems accessing EJB3.0 EJB services currenlty hosted on JBoss 4.2.3 from web app deployed to JBoss EAP 5.1.0, here is stack :
Caused by: java.lang.ClassNotFoundException: org.jboss.ejb3.JBossProxy (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:535)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
at org.jboss.system.JBossRMIClassLoader.loadProxyClass(JBossRMIClassLoader.java:82)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:769)
Resolution
Since the war is isolated and parentDelegation=false in by default, copying these jars from the JBoss EAP 4.x $JBOSS_HOME/client/ directory into the war's WEB-INF/lib will fix the issue.
* jboss-ejb3-client.jar
* jboss-aop-jdk50-client.jar
Note this will only work for non EJB deployments that are isoalted and parentDelegation=false
Note: the jbossall-client.jar can be packaged in a war which has an EJB client and should allow the client in the war to call the EJB on the other server. If you have a war in JBoss EAP 4.x trying to call JBoss EAP 5.x EJB, remember that the $JBOSS_HOME/client/jbossall-client.jar does not contain any classes, it just hase references to the other classes in the client directory, so you will need to copy all the jars from the $JBOSS_HOME/client/ into the war's WEB-INF/lib.
For more options see RMI (EJB3) calls between JBoss EAP 4.x and JBoss EAP 5.0 [1]
Root Cause
- EJB RMI invocations changed between EAP 4.x and EAP 5.x
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments