Thursday, October 28, 2004

Accessing EJBs using local interfaces

I was having a problem accessing the local interface of an EJB, that have been deployed as separate jars. i.e 1st EJB is in a Jar file and it attempts to access a local interface in 2nd EJB in another jar deployed on Weblogic8.1

According to the spec local interface access works only for objects that lie within the same JVM but Weblogic container restricts it further to the same application (JAR, EAR) .

The local home interface— If the home interface of the bean extends from the interface javax.ejb.EJBLocalHome instead of the javax.ejb.EJBHome interface, the bean can be efficiently used by other objects residing within the same container. This interface offers bean life cycle methods similar to those of the remote home interface. The difference between the two is that when beans are created using this interface, no network connectivity is involved because both the requested and the requester exist within the same application, which significantly improves performance. This interface works in conjunction with the local interface. Remember that the specification talks about using local interfaces for objects that lie within the same JVM, but the WebLogic container restricts it further to the same application (that is, JAR, EAR, and so on) This is a direct consequence of the class loader scheme adopted by WebLogic Server, which basically uses objects within the same application only.



This has a lot to do with the way the class are loaded in Weblogic 8.1 and the classloader hierchy in Weblogic 8.1, see the docs here

No comments: