JNDI lookup from outside the JRun container
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   srinivasan_venkataraman
Posted On:   Wednesday, September 12, 2001 12:13 PM

Hi all, I am working with Jrun 3.1, created datasource called testdb using JMC and successfully tested it. Now I want to use this datasource name ( testdb - the name which is binded with JNDI already in Jrun ) outside the jrun container using JNDI lookup. I issued the following command java -Djava.naming.factory.initial=allaire.jrun.ContextFactory GetCon The response for this ======================================== message testdb not found javax.naming.NameNotFoundException: testdb not found at allaire.jrun.LocalContext.lookup(LocalContext.java:214) at allaire.jrun.LocalContext.lookup(LocalContext.java:236) at allaire.jrun.LocalContext.lookup(LocalC   More>>




Hi all,


I am working with Jrun 3.1, created datasource called testdb using JMC and successfully tested it. Now I want to use this datasource name ( testdb - the name which is binded with JNDI already in Jrun ) outside the jrun container using JNDI lookup. I issued the following command

java -Djava.naming.factory.initial=allaire.jrun.ContextFactory GetCon



The response for this
========================================
message testdb not found
javax.naming.NameNotFoundException: testdb not found
at allaire.jrun.LocalContext.lookup(LocalContext.java:214)
at allaire.jrun.LocalContext.lookup(LocalContext.java:236)
at allaire.jrun.LocalContext.lookup(LocalContext.java:236)
at allaire.jrun.LocalContext.lookup(LocalContext.java:236)
at allaire.jrun.LocalContext.lookup(LocalContext.java:195)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at GetCon.ds8iCon(GetCon.java:16)
at GetCon.main(GetCon.java:25)
=======================================


code snippet
=======================================
Connection con = null;
// Define JNDI InitialContext object.
InitialContext ctx = new InitialContext();
// Look up data source in InitialContext


String dsName = "testdb";
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/" + dsName);
con = ds.getConnection();
=======================================

Basically I want to use the jndi components created in JRun from outside the Jrun container. Is anyone has idea about this ?


Your assistance is greatly appreciated.


Thank You


srini

   <<Less
About | Sitemap | Contact