tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Dunwoody <james.dunwo...@sytec.co.nz>
Subject JNDI lookup from console app
Date Mon, 15 Sep 2003 04:20:00 GMT
Hello everyone,

I'm trying to lookup a DataSource using JNDI configured within Tomcat (I'm
not using JBoss) from an application that isn't in the container (i.e. a
console app). 

1. Is Tomcat's JNDI available to application outside of the container? 

2. If so what are the properties that I would need to set in order to get an
initial context?

Here are my uninformed guesses:

Properties props = new Properties();

//props.put("java.naming.factory.initial","com.sun.jndi.rmi.registry.Registr
yContextFactory");
//props.put("java.naming.factory.initial",
"org.apache.naming.java.javaURLContextFactory");
//props.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextF
actory");

//props.put("java.naming.provider.url","rmi://localhost:1099");
//props.put("java.naming.provider.url","localhost:1099"); 
//props.put("java.naming.provider.url","jnp://localhost:1099"); 

InitialContext context = new InitialContext(props);

James Dunwoody
Software Engineer 
Sytec Resources Limited 



Mime
View raw message