6 Replies Latest reply on Nov 16, 2001 11:39 AM by Wolf-Dieter Fink

    lookup Datasource / Difference between JBoss 2.2 => 2.4

    Wolf-Dieter Fink Master

      The request:
      Normaly work with CMP Beans. Writing SessionsBeans with JDBC access to the CMP data for a better performance.

      My Code:
      public void setSessionContext(SessionContext context) {
      this.ctx = context;
      Context jndiCtx;
      try {
      jndiCtx = new InitialContext();
      myDB = (DataSource)jndiCtx.lookup("java:comp/env/myDB");
      }catch ......


      this works properly with JBoss2.2

      After an upgrade to JBoss 2.4 the following Exception occoured:
      javax.naming.NameNotFoundException: iprofileDB not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      . . .

      some attempts with <res-ref-name> like /myDB or myDB produce messages like this during the JBoss startup:

      [Container factory] No resource manager found for myDB

      My Question:
      What is the best way to get a JNDI reference to the CMP database and is the name configurable in the DeploymentDescriptor?