I have one session
ejb deployed on serverA with jndi name: ejb/MySLSBRemoteHome
I have one web client deployed on serverB with the following DD segment:
Both are running weblogic 8.12.
web.xml
<ejb-ref>
<ejb-ref-name>test/myejb</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>test.MySLSBHome</home>
<remote>test.MySLSBRemote</remote>
</ejb-ref>
weblogic.xml
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>test/myejb</ejb-ref-name>
<jndi-name>ejb/MySLSBRemoteHome</jndi-name>
</ejb-reference-description>
</reference-descriptor>
index.jsp
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://severA:7001");
Context initial = new InitialContext(prop);
Object objref = initial.lookup("java:comp/env/test/myejb");
MySLSBHome home =
(MySLSBHome)PortableRemoteObject.narrow(objref,
MySLSBHome.class);
MySLSBRemote bean = home.create();
Now the problem is that i get an exception:
javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundExcept
ion: Unable to resolve 'ejb/MySLSBRemoteHome' Resolved ejb; remaining name 'MySLSBRemoteHome'
But when i change the lookup to initial.lookup("ejb/MySLSBRemoteHome"); it will work. But i am supposed to use "java:comp/env/test/myejb", right?
Can anyone of you help me out? Thanks in advance