0 Replies Latest reply on Oct 1, 2002 7:32 AM by Sergei Batiuk

    "Could not dereference object" while looking up a datasource

    Sergei Batiuk Newbie


      My environment is:

      JBoss-3.0.2+Tomcat-4.0.4 (integrated)
      JDK 1.4

      I am trying to access a datasource from a web app, using this code:

      Context ctx = new InitialContext();
      DataSource ds = ( DataSource )ctx.lookup( "java:comp/env/jdbc/DeptFuncDS" );

      However, I get the

      javax.naming.NamingException: Could not dereference object [Root exception is java.lang.NullPointerException].

      What is the problem? If there is an error, what is a correct way to lookup a data source from a web-app?

      My jboss-web.xml:

      <?xml version="1.0"?>

      Note: java:/OkeanTestDS works correctly with CMP EJBs.

      Snip from the web.xml:
      <?xml version="1.0"?>