Hi,
I am trying to make remote jndi look up by passing the following properties to initial context. Looks Initialization is done properly, but look up is failing.
Here is code I am trying -
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
env.put(Context.URL_PKG_PREFIXES, "com.sun.enterprise.naming");
env.put(Context.STATE_FACTORIES, "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
env.put(Context.PROVIDER_URL,"iiop://10.1.1.52:3700");
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
try
{
initialContext = new InitialContext(env);
return (DataSource) initialContext.lookup("jdbc/testDataSource");
}catch(NamingException ne){
ne.printStackTrace();
}
I have included appserv-admin.jar, appserv-rt.jar, javaee.jar,imqjmsra.jar in class path. Still getting the following exception.
Jul 1, 2009 3:12:32 PM com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo
WARNING: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.
endpoints.
Jul 1, 2009 3:12:32 PM com.sun.appserv.naming.RoundRobinPolicy getEndpointForProviderURL
WARNING: NAM1001: No Endpoints selected in com.sun.appserv.iiop.endpoints property. Using JNDI Provi
der URL iiop://10.1.1.52:3700 instead
Jul 1, 2009 3:12:33 PM com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo
INFO: endpoint.weight after checking isWeight = 10
Jul 1, 2009 3:12:33 PM com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo
INFO: sumOfAllWeights = 10
Jul 1, 2009 3:12:34 PM com.sun.appserv.naming.S1ASCtxFactory getCorbalocURL
INFO: list[i] ==> 10.1.1.52:3700
Jul 1, 2009 3:12:34 PM com.sun.appserv.naming.S1ASCtxFactory getCorbalocURL
INFO: corbaloc url ==> iiop:1.2_at_10.1.1.52:3700
Initialization is done
Jul 1, 2009 3:12:35 PM com.sun.enterprise.naming.SerialContext lookup
SEVERE: NAM0004: Exception during name lookup : {0}
com.sun.enterprise.connectors.ConnectorRuntimeException: Failed to look up ConnectorDescriptor from
JNDI
at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjec
tFactory.java:98)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:414)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
Please suggest.
Thanks in advance.
Regards,
Krishna
[Message sent by forum member 'saisimple' (saisimple)]
http://forums.java.net/jive/thread.jspa?messageID=353843