Search code examples
ejbweblogicwarear

How to access an EJB in an ear from a war?


I have two Projects deployed on the same weblogic server:

  1. An ear archive with an EJB (@Local, @Stateless)
  2. A war archive

I want to access the EJB from a class inside the war archive. Is this generally possible? How?


Solution

    1. Interface needs @Remote
    2. Stateless annotation of EJB class needs mappedName = "ejb/myEJB"
    3. Lookup with "ejb.MyEJB#mypackage.MyEJBInterface"