abiya [
http://community.jboss.org/people/abiya] created the discussion
"JNDI lookup fails in Filter/Servlet's init() method"
To view the discussion, visit:
http://community.jboss.org/message/638609#638609
--------------------------------------------------------------
Hi,
I am able to perform JNDI lookup using the following code in my servlet,
DataSource ds = null;
Context ctx = null;
try {
String strDSName = "java:jboss/datasources/Test";
ctx = new InitialContext();
ds = (javax.sql.DataSource) ctx.lookup(strDSName);
} catch (Exception e) {
}
I need to have lookup from servlet and filter's init() method which looks like a
problem. It throws javax.naming.NameNotFoundException. Any input on this would be of great
help.
Thanks,
Abiya
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/638609#638609]
Start a new discussion in JNDI and Naming at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]