5 Replies Latest reply on May 24, 2002 12:55 AM by Vicky Kak

    help! datasource jndi lookup!

    microwin Newbie

      My jboss is JBoss-2.4.4_Tomcat-4.0.1 !
      where start jboss ,there is no errors ,and the datasource is bound to java:/DefaultDS!
      but when I lookup the jndi name ,happen errors :
      javax.naming.NameNotFoundException: DefaultDS not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at com.microwin.JbossEjbClient.dbpool(JbossEjbClient.java:48)
      at com.microwin.JbossEjbClient.main(JbossEjbClient.java:60)

      My program is :

      try {
      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
      p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
      InitialContext initCtx = new javax.naming.InitialContext(p);
      initCtx.lookup("java:/DefaultDS");
      }
      catch (Exception ex) {
      ex.printStackTrace();
      }


      please help me! thanks!