-
1. Re: JNDI lookup fails with JBoss4.0.4GA Patch1
peterj Nov 14, 2006 10:44 AM (in response to msmail315)What is the name of you data source in the *-ds.xml file? Is it "MySqlDS" or "jdbc/MySqlDS"? If the former, change the lookup to ctxt.lookup("java:/MySqlDS");
-
2. Re: JNDI lookup fails with JBoss4.0.4GA Patch1
msmail315 Nov 14, 2006 2:09 PM (in response to msmail315)The Data Source is set to MySqlDS. Also I changed the lookup to java:/MySqlDS. When I invoke it on a JSP, the data source lookup is returning null. Reading thru' different internet articles, can the data source only be accessed from an EJB or can it be accessed from a POJO, JSP and/or Servlet? If so, how can it be done?
-
3. Re: JNDI lookup fails with JBoss4.0.4GA Patch1
peterj Nov 14, 2006 2:22 PM (in response to msmail315)I quite often access my data sources from servlets or pojos (usually the later unless I am doing something quick and dirty). Since I can access them from a servlet, I should be able to access them from a JSP (which is really a servlet in disguise).
What you have now (java:/MySqlDS) should work, based on what you have written. What I would try next is just opening "java:", it should be a context, and then listing its contents. -
4. Re: JNDI lookup fails with JBoss4.0.4GA Patch1
jerrygauth Nov 14, 2006 4:13 PM (in response to msmail315)Have you tried the lookup without the "/" character? If I define a data source with a JNDI name of "MySource", I can look it up in a servlet using java:MySource.