mmierins
mmierins

Reputation: 3774

How to access EJB defined in one EAR from another EAR

Basically, I have a situation where I have to access EJB declared in a JAR within one EAR from WAR in another EAR. Both EARs are deployed to the same WebLogic managed server (same domain). No annotations are used for that EJB in Java code. In ejb-jar.xml it is defined as session stateless container bean. In WebLogic-ejb-jar.xml there is local-jndi-name specified. I tried to look-up this bean using InitialContext and get it LocalHome interface and from that - Home interface. No matter what I try to use as JNDI name in context lookup I get "javax.naming.NameNotFoundException: While trying to look up ". Also there are Local and LocalHome interfaces for that bean programmed in Java. What am I doing wrong?

Upvotes: 0

Views: 804

Answers (1)

jtahlborn
jtahlborn

Reputation: 53674

You should be using Remote interfaces between ejbs in different ears. Some app servers may let you use Local interfaces between ears, but it's fraught with difficulty (e.g. classpath problems) and by far not the best idea.

Upvotes: 1

Related Questions