Originally posted by John Meyers:
I am not sure I follow. You have 2 JNDI contexts ? If the scheduler has access to the same JNDI that the name is bound to, there should be no problem accessing the bound object
actually...the thread code doesn't know the context information and I don't know how to tell it.
when I setDataSourcename this is the error I get
select.setDataSourceName((String)new InitialContext().lookup("java:comp/env/espConn"));
[6/23/08 12:10:40:562 EDT] 0000003c SystemErr R javax.naming.NameNotFoundException: Name "comp/env/espConn" not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1094)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:990)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:201)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:142)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at net.ongov.esp.resources.LocalExamSeriesForExamPostedToday.initializer(LocalExamSeriesForExamPostedToday.java:44)
at net.ongov.esp.resources.LocalExamSeriesForExamPostedToday.<init>(LocalExamSeriesForExamPostedToday.java:27)
at net.ongov.esp.resources.ScheduledExamNotification.scheduleJob(ScheduledExamNotification.java:100)
at net.ongov.esp.resources.ScheduledExamNotification$1.run(ScheduledExamNotification.java:316)
at java.util.TimerThread.mainLoop(Timer.java:447)
at java.util.TimerThread.run(Timer.java:397)
Any suggestions? how can I get the context that the servlet is using