0 Replies Latest reply on May 15, 2002 10:30 AM by Colin Canfield

    mbean always null in jndi lookup

    Colin Canfield Newbie

      I have a mbean that I launch via a deployed service.


      It is an instance of castorjdoimpl; I know it is registering OK as I've stepped through it...

      The binding section of its code is pretty standard

      bind(new InitialContext(), "java:/" + _jndiName, this);

      when I look at it in the mbean view it seems to be there properly (jdo/exercises). It is both in the jndi viewer and in the service list.

      When I do a lookup from my web application (not from an ejb is this a problem ?) using what seems to be pretty standard

      InitialContext ic = new InitialContext();
      DataObjects exercises = (DataObjects) ic.lookup ("java:/jdo/exercises");
      if (exercises == null) {
      errors.error ("JDO has not been correctly configured for the exercises database");
      returnVal = false;
      }

      exercises is always null (although it is the correct type);

      I'm really stuck here, any help would be appreciated!

      thanks Colin