Have you tried starting your main class in a client container? Theoretically, that is the J2EE way. Then you will benefit from several services, like java:comp/env name space, DataSource pooling etc. Without a client container, it is not possible to resolve java:comp/env look-ups.
I can't see anything wrong in your attempt, as long as you use the global namespace to which you have deployed your EJB and that you have the com.sun.jndi.cosnaming.CNCtxFactory class on your classpath, /Johan -----Original Message----- From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]]On Behalf Of Kenny MacLeod Sent: den 19 december 2001 17:42 To: [EMAIL PROTECTED] Subject: Standalone JNDI lookup on 1.3 RI Server I'm having trouble binding a standalone application to the JNDI naming service on a 1.3 RI server: public static void main( String[] args ) { Hashtable env = new Hashtable(); env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory" ); env.put( "java.naming.provider.url", "iiop://localhost:1050" ); Context context = new InitialContext( env ); context.lookup( args[ 0 ]); } The lookup() method always throws a NameNotFoundException. I've tried various names, including java:comp/env ejb/TheConverter (the JNDI name of the deployed bean) java:comp/env/ejb/TheConverter but none works. Is this the correct way to bind to the naming service? cheers kenny =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
