ejb-reference-description in weblogic.xml is not working
843829May 7 2003 — edited May 7 2003I have the appropriate ejb-ref in my web.xml file...
<ejb-ref>
<ejb-ref-name>com.nam.onesource.fsi.MySesionHome</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.nam.onesource.fsi.MySesionHome</home>
<remote>com.nam.onesource.fsi.MySesion</remote>
<ejb-link>MySessionBean</ejb-link>
</ejb-ref>
And since we are deploying on Weblogic 7.0, the appropriate piece in the weblogic.xml:
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>com.nam.onesource.fsi.MySesionHome</ejb-ref-name>
<jndi-name>MySessionBeanJNDI</jndi-name>
</ejb-reference-description>
</reference-descriptor>
The jndi name exactly matches the jndi name given in weblogic-ejb-jar.xml file and the <ejb-link> exactly matches the <ejb-name> in ejb-jar.xml file.
When I see the web application load up in the Weblogic server log, it is correctly associated with the ejb-ref with the jndi-name, but at runtime when I try to look up the bean from the servlet with the folowing code,
Class c = com.nam.onesource.fsi.MySessionHome.class;
String string = "java:comp/env/" + c.getName();
Context ctx = new InitialContext();
home = (EJBHome)PortableRemoteObject.narrow(ctx.lookup(string), c);
The association is not made. The lookup is done with the name "com.nam.onesource.fsi.MySesionHome" which should actually be "MySessionBeanJNDI". Please help me out...
thanks
manish