1 Reply Latest reply on Oct 23, 2001 10:36 PM by David Jencks

    JCA and EJB Question == NameNotFoundException: BlackBoxDS no

    kumar Newbie

      I am trying to lookup the pre-configured Minerva Local Transaction Connector in JBoss 2.4.3 server, Its erroring out saying NameNotFoundException BlackBoxDS not bound.

      I also tried with Java:/MinervaDS. I get the same error message.

      Any help is appreciated.

      This is how I lookup in JNDI, I am doing the lookup from a Session Bean.

      private Context getInitialContext() throws NamingException
      String ejbUrl = "jnp://localhost:1099";
      InitialContext jndiContext;
      Properties h = new Properties();
      String initialContextFactory = "org.jnp.interfaces.NamingContextFactory";
      h.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
      h.put(Context.PROVIDER_URL, ejbUrl);
      jndiContext = new InitialContext(h);
      return jndiContext;
      catch (NamingException ne)
      System.out.println(" Unable to get a connection to the server at " + ejbUrl);
      System.out.println("Please make sure that the server is running.");
      throw ne;

      public int getAcctAmt()

      Context ic = getInitialContext();
      System.out.println(" INSIDE SET SESSION CONTEXT ");
      Connection con = (Connection) ic.lookup("java:BlackBoxDS");

      Statement qry = con.createStatement();
      catch(Exception e)
      return 7;

        • 1. Re: JCA and EJB Question == NameNotFoundException: BlackBoxD
          David Jencks Master

          There are several confusing aspects to what you are doing.

          I may be wrong, but I think the main source of your problem is that you are forcing jndi to go through tcp/ip with your initial context getting method. This will make anything bound in the java: namespace inaccessible. What happens if you remove your getInitialContext() method and replace calls to it with new InitialContext()?

          The other confusing aspect is why you are referring to BlackBoxDS. This hasn't been in jboss since 2.2 or earlier. Are you using jboss.jcml that came with 2.4.3? I recommend not mixing configuration files. Sometimes the changes between versions are very hard to spot. As I recall, the ConnectionFactoryLoader in 2.4 was MinervaDS, which ought to be under java:MinervaDS or java:/MinervaDS.

          If you continue to have problems please show at least the jboss.jcml configuration of the ConnectionFactoryLoader you are trying to use and, any relevant bean configuration, and a stack trace.