users@glassfish.java.net

Re: JNDI lookup problem for standalone client : NameNotFoundException

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Sep 2008 07:56:42 PDT

Hi Rajeev,

A plain Java SE client does not have access the java:comp/env namespace. java:comp/env is only available to code running within an EE container. For your client you'll need to use a global JNDI name. In Glassfish, the global JNDI name for a Remote interface defaults to the
fully-qualified interface name, so try this instead :

   new InitialContext().lookup("ejb_stateful.CartRemote");

We have more information on these topics in our EJB FAQ :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
[Message sent by forum member 'ksak' (ksak)]

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