users@glassfish.java.net

ejb JNDI lookup failed

From: <forums_at_java.net>
Date: Thu, 21 Apr 2011 07:24:07 -0500 (CDT)

I tried to lookup an ejb in a remote location in Glassfish 3.1

        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",
"192.168.1.95");
        props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
        InitialContext ic = new InitialContext(props);
        UserManagementServiceRemote    service =
(UserManagementServiceRemote)
ic.lookup("java:global/SampleEAR/SampleEJB/ConnectUserManagementServiceEJB!com.commons.UserManagementServiceRemote");
 

and I got following exception

Exception in thread "main" javax.naming.NamingException: Lookup failed for
'java:global/SampleEAR/SampleEJB/ConnectUserManagementServiceEJB!com.commons.UserManagementServiceRemote'
in SerialContext ,orb'sInitialHost=192.168.1.95,orb'sInitialPort=3700 [Root
exception is javax.naming.NameNotFoundException:
ConnectUserManagementServiceEJB!com.commons.UserManagementServiceRemote not
found]
    at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
    at javax.naming.InitialContext.lookup(InitialContext.java:409)
    at com.test.TestConnect.main(TestConnect.java:56)
Caused by: javax.naming.NameNotFoundException:
ConnectUserManagementServiceEJB!com.commons.UserManagementServiceRemote not
found
    at
com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:197)
    at
com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:168)
    at
com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
    at
com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
    at
com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
    at
com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:58)
    at
com.sun.enterprise.naming.impl.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:89)
    at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:146)
    at
com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:176)
    at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:682)
    at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:216)
    at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1841)
    at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1695)
    at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1078)
    at
com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:221)
    at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:797)
    at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:561)
    at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2558)
    at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:492)
    at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:528)

 

Please advice to fix this problem ...
 


--
[Message sent by forum member 'hemanthms']
View Post: http://forums.java.net/node/794089