I want to Look up JMS Objects from WebSphere JNDI using SUN JVM. I am using following code and it seems to return null. I am using SUN JVM on windows and j2ee.jar , com.ibm.mq.jar, com.ibm.mqjms.jar on the classpath. I can look up a context , for exmpale lookup of "cell/nodes/localhost/servers/server1/jms" returns a CNCtx and i can run list on it and it gives everything that is defined under it, but the actual lookup returns null.

String contextFactory = null;

String jndiPath = "cell/nodes/localhost/servers/server1/";
String jmsqcfpath = "jms/Test";

String host = "localhost";
String port = "2809";

String factory = args[0];

if (factory.equals("IBM_JDK"))
{
contextFactory = "com.ibm.websphere.naming.WsnInitialContextFactory";
}
else if (factory.equals("SUN_JDK"))
{
contextFactory = "com.sun.jndi.cosnaming.CNCtxFactory";
}

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
env.put(Context.PROVIDER_URL, "corbaloc:iiop:" + host + ":" + port);

String key = jndiPath +jmsqcfpath;
Object objref = initial.lookup(key);
System.out.println(key + " : " + objref);