3 Replies Latest reply on May 30, 2004 11:32 PM by gorano

    lookup datasource from java client

    erahamim Newbie

      I am tring to look up datasource from java client using the following code:
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put (Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      env.put(Context.PROVIDER_URL, "jnp://localhost:9753");
      Context ctx = new InitialContext(env);
      DataSource ds = (DataSource)ctx.lookup("java:/datasourceDS");

      I get javax.naming.NameNotFoundException

      Using this code I can look up for Ejb but not datasource.

      Does anybody know what should I do ?