• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I use local interface?

 
Kelly Walker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,

I am running WebLogic 8.1 sp3.

I have 2 ejb modules (2 x ejb jar files) each with only 1 EJB.

I deploy each module to the same managed server but it seems I cannot use the local interfaces to call 1 EJB from the other.

I thought this would be ok because these bean will run in the same JVM.

Can someone explain why I must use the remote interfaces? Did I do something wrong?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The called EJB has remote interfaces, it must have local interfaces to be called locally.

Alternatively, keep the remote interfaces and enable pass-by-reference in the WebLogic deployment decriptor for more efficient calling of remote EJBs.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kelly,


I have 2 ejb modules (2 x ejb jar files) each with only 1 EJB.

I deploy each module to the same managed server but it seems I cannot use the local interfaces to call 1 EJB from the other.

I thought this would be ok because these bean will run in the same JVM.

Can someone explain why I must use the remote interfaces? Did I do something wrong?

In order for your beans to communicate throufg the local interfaces, two conditions (at least these two I remember :-)) must be met:
  • They both must run within the same jvm (which your deployment architecture meets).
  • They both must be loaded by the same classloader (which almost certainly your deployment architecture doesn�t meet).


  • In order to fix this issue repack both ejb.jars within an ear and redeploy them to the cluster (or any managed instance if you wish � and by the way, why would you do this? :-)). By J2EE specification this should work for any container. Another solution that might work is to add those classes to the system classpath, but this is an extremely bad practice and it could not be supported by all containers (check your container�s classloading architecture by the way).
    Regards.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!