users@glassfish.java.net

Re: binding webservice to jndi name doesn't work

From: <glassfish_at_javadesktop.org>
Date: Mon, 12 Apr 2010 08:41:58 PDT

> In what context is the lookup performed? It needs to
> be done within the context of a business method or
> standard callback method of the bean that declared
> the service-ref.

It is done within a business method of the MyClientBean.

Here is the stack trace:

[code]
javax.naming.NameNotFoundException: No object bound to name java:comp/env/service/MyService
        at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:834)
        at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.example.MyClientBean.getWebService(MyClientBean.java:98)
[/code]

Line 98 of MyClientBean is the cxt.lookup("java:comp/env/service/MyService");
[Message sent by forum member 'hupfdule']

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