• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can I use local interface?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic