users@glassfish.java.net

glassfish v2.1 JNDI?

From: <glassfish_at_javadesktop.org>
Date: Wed, 20 May 2009 09:45:08 PDT

EJB3:

@Stateless(name = "SimpleSecurityBean", mappedName = "TEST123JNDI")
public class SimpleSecurityBean implements SimpleSecurityProcessorRemote
{...}

-----------------------------------------------------------------------------------------------

test main class:

Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");

InitialContext ic = new InitialContext(props);

Object obj = ic.lookup("TEST123JNDI");
System.out.println(obj);

------------------------------------------------------------------------------------------
but got a “Exception in thread "main" javax.naming.NameNotFoundException: CC2JNDI not found”
"D:\Software\glassfish\domains\domain1\autodeploy\c-ejb.jar_deployed" is exists


in http://localhost:4848 "JNDI VIEW" is nothing?
how to get JNDI name?
[Message sent by forum member 'freedomch2' (freedomch2)]

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