users@glassfish.java.net

Re: jndi failure NameNotFoundException for local interface lookup

From: <glassfish_at_javadesktop.org>
Date: Tue, 26 Feb 2008 14:17:53 PST

Based on your advice, I entered the following entry into web.xml:

<ejb-local-ref>
<ejb-ref-name>com.forelogic.flhcs.common.ChargePlanSessRemote</ejb-ref-name>
<local>com.forelogic.flhcs.common.ChargePlanSessRemote</local>
<ejb-link>ChargePlanSessBean</ejb-link>
</ejb-local-ref>

My JSP indirectly invoked a POJO to lookup this bean as:

...
public ChargePlanSessRemote create() throws CreateException, RemoteException, Exception {
return (ChargePlanSessRemote)new javax.naming.InitialContext().lookup("java:comp/env/ChargePlanSessBean");
}
...

This still returned error:

javax.naming.NameNotFoundException: No object bound to name java:comp/env/ChargePlanSessBean

Also, my bean decl looks like:

...
@Stateless(name="ChargePlanSessBean")
public class ChargePlanSessBean implements ChargePlanSessRemote {
...

And my Local looks like (disregard the reverse naming "Remote" as this whole package was running as Remote on JBoss):

...
@Local
public interface ChargePlanSessRemote {
...

Anyhow, this setup is a bit much to simply accommodate a Local interface - I'd rather leave all as-is (ie truely "remote") and rely on <pass-by-reference> to trigger the "local" behavior for all ejb remotes from the sun-application.xml...but as I indicated earlier that [b]no workee! Please help regarding <pass-by-reference>![/b]
[Message sent by forum member 'jameshr' (jameshr)]

http://forums.java.net/jive/thread.jspa?messageID=261078