You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steven Pannell <st...@zooplus.com> on 2005/02/17 17:13:21 UTC
configure a jndi resource
Hi,
I would like to configure my jms router resource directly in tomcat and
perform a jndi lookup to get this resource. But I am not sure how this is
working. For example in the code I have this:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.swiftmq.jndi.InitialContextFactoryImpl");
env.put(Context.PROVIDER_URL, "smqp://192.168.10.54:4001/timeout=10000");
Context jndiContext = new InitialContext(env);
Queue q1 = (Queue)jndiContext.lookup("myQueue");
What I would like to do is configure the router in tomcat so I can do this
in the code:
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
Queue ds = (Queue)initContext.lookup("myQueue");
Does anyone know how I can do this??
Thanks for listening,
Steve.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org