1 Reply Latest reply on Jul 11, 2008 2:23 AM by jaikiran pai

    Datasource Lookup Problem

    Adrian layne Newbie

      I am trying to deploy an application that has predefined datasource names

      I added a jboss-web.xml to the web-inf folder with these contents


      The web.xml has the following resource ref

      jdbc/blah Connection

      javax.naming.InitialContext ctxt = new javax.naming.InitialContext();
      javax.sql.DataSource ds = (javax.sql.DataSource) ctxt.lookup("jdbc/blah");
      java.sql.Connection conn = ds.getConnection();

      when i run the app i get the following exception

      javax.servlet.ServletException: javax.naming.NameNotFoundException: jdbc not bound

      if i change the look up from ctxt.lookup("jdbc/blah"); to ctxt.lookup("java:jdbc/blah"); it works.