3 Replies Latest reply on Jul 21, 2004 5:56 AM by matpil

    jndiContext.lookup(

    lbax

      I have been using jboss 2.4.4 and I decided to switch to jboss 3.2.3.
      I have a clean Jboss 3.2.3 installation. I have only modified jbossmq-state.xml and jbossmq-destinations-service.xml to add users and topics. I get no errors at JBoss startup.

      Then I try to run the following:

      Hashtable props = new Hashtable();
       props.put(Context.INITIAL_CONTEXT_FACTORY,
       "org.jnp.interfaces.NamingContextFactory");
       props.put(Context.PROVIDER_URL, server);
       props.put("java.naming.rmi.security.manager", "yes");
       props.put(Context.URL_PKG_PREFIXES,
       "org.jboss.naming:org.jnp.interfaces");
       jndiContext = new InitialContext(props);
      
       topicConnectionFactory = (TopicConnectionFactory)
       jndiContext.lookup("UIL2ConnectionFactory");


      The returned topicConnectionFactory is null. I don't get NamingException or JMSException. Using the same context I can lookup topics I have defined in jbossmq-state.xml. I am missing something here?

      Thank you in advance.

        • 1. Re: jndiContext.lookup(

          You probably have old jboss-2.4 client jars in your classpath or jre/lib/ext

          There was an old bug in jnp where it would return null rather than throw
          a NamingException.

          See "READ THIS FIRST" on how to debug.

          • 2. Re: jndiContext.lookup(
            lbax

            You guessed right.
            I works fine now.
            Thank you very much for your prompt reply.

            lbax

            • 3. Re: jndiContext.lookup(
              matpil

              Hi all,
              I've the same problem of Ibax.
              I call a bean from jboss 3.2.5 to jboss 2.4.4 and naturally it doesn't work.
              Now I update the client jar file in classpath (I've add to classpath new jar file and delete the old one). The application, go to error to :(
              Perhaps I've to replace the old jar file?!!?!?

              P.s. I've add client jar of jboss 3.2.5