This content has been marked as final.
Show 5 replies
-
1. Re: JNDI and DefaultDS
waynebaylor Aug 16, 2007 9:34 AM (in response to axel.becker)could you provide the code you're using to do the lookup?
-
2. Re: JNDI and DefaultDS
axel.becker Aug 16, 2007 5:10 PM (in response to axel.becker)"waynebaylor" wrote:
could you provide the code you're using to do the lookup?
i use the this two rows:InitialContext ic = new InitialContext(); ic.lookup("java:/DefaultDS");
-
3. Re: JNDI and DefaultDS
waynebaylor Aug 16, 2007 5:25 PM (in response to axel.becker)the lookup looks good.
maybe try printing out the contents ofnew InitialContext().getEnvironment();
the context should contain the equivalent of doing this:Properties p = new Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces"); p.put(Context.PROVIDER_URL, "localhost:1099"); Context ctx = new InitialContext(p);
-
4. Re: JNDI and DefaultDS
axel.becker Aug 18, 2007 5:49 AM (in response to axel.becker)new InitialContext().getEnvironment();
returns this map:{java.naming.provider.url=localhost:1099, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces}
i tried a new datasource too. (MySQLDS from the conf-folder). Its the same problem.
i use windows vista. maybe this is the cause of this problem... -
5. Re: JNDI and DefaultDS
jaikiran Aug 18, 2007 3:13 PM (in response to axel.becker)"axel.becker" wrote:
After that i have build a small webapplication which contains a ServletContextListener.
Now i want to lookup the DefaultDS in the "contextInitialized"-Method of my ServletContextListener
Instead of looking it up from the ServletContextListener, try looking it up from a servlet/jsp and see if that works. That might give us a clue as to whether the ServletContextListener is being called even before the datasource is bound to the JNDI tree