You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Frank Renaers <Fr...@ikan.be> on 2003/12/10 12:03:44 UTC
Tomcat 5 - jndi problem
Hi,
Is it possible to browse the Tomcat jndi context from within another vm.
I wrote a small junit test to test this, but it always fails !!
It always throws a javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
My jndi.properties contains the following settings :
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
java.naming.provider.url=http://localhost:8080
My conf.xml :
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
</GlobalNamingResources>
My test :
public void testDataSource() throws Exception {
// Obtain our environment naming context
javax.naming.Context initCtx = new javax.naming.InitialContext();
javax.naming.Context envCtx = (javax.naming.Context) initCtx.lookup("java:comp/env/simpleValue");
}
}
Thanks,
Frank Renaers