-
1. Re: How to call an EJB in one EAR from another EAR in the same server?
nickarls Mar 5, 2013 1:33 AM (in response to kieras1)You might be able to shuffle around the location but I guess the information has to be somewhere...
-
2. Re: How to call an EJB in one EAR from another EAR in the same server?
kieras1 Mar 5, 2013 9:11 AM (in response to nickarls)I see... You're right.
Maybe I just didn't want to believe.
Thank you very much, Nicklas!
-
3. Re: How to call an EJB in one EAR from another EAR in the same server?
erhard Jul 28, 2016 12:26 PM (in response to kieras1)I came across the same problem. What I don't like on the global jndi-name is, that it is not refactoring friendly. The solution I came across is the following:
On the service-side I annotate the EJB with
@Resources( {
@Resource(name="java:/services/StringConverter", lookup="java:module/ConverterBean"),
})
@Stateless
@Remote(StringConverter.class)
public class ConverterBean implements StringConverter{...}
On the client side I inject:
@EJB(mappedName="java:/services/StringConverter")
StringConverter svc1;
Full example on https://github.com/Gepardec/jboss-examples/tree/master/call-ejb-between-deployments
Still not perfect, but probably better. We do have many EJBs in one big EAR that I want to take apart, so every improvement is welcome.