7 Replies Latest reply on Oct 29, 2002 10:55 PM by sordes

    ConnectionFactory lookup

    cfg123

      hi all,
      When i want to lookup the QueueConnectionFactory in my program, no any exception shown. But the QueueConnectionFactory i get is in null value. Can anybody help me. Is there still any setting i need to do?

      QueueConnectionFactory queueFactory =
      (QueueConnectionFactory)context.lookup("ConnectionFactory");

        • 1. Re: ConnectionFactory lookup
          joelvogt

          not sure. What context are you using? Is this in jboss or an external client?

          • 2. Re: ConnectionFactory lookup
            cfg123

            sorry, this is the context used in my program....

            System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
            System.setProperty("java.naming.provider.url", "192.90.1.19:1099");

            Context context = new InitialContext();
            QueueConnectionFactory queueFactory =(QueueConnectionFactory)context.lookup(factoryJNDI);

            • 3. Re: ConnectionFactory lookup
              cfg123

              sorry, this is the context used in my program....

              System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
              System.setProperty("java.naming.provider.url", "192.90.1.19:1099");

              Context context = new InitialContext();
              QueueConnectionFactory queueFactory =(QueueConnectionFactory)context.lookup(factoryJNDI);

              • 4. Re: ConnectionFactory lookup
                cfg123

                Sorry, the context i used here is just a normal context in jboss. The program is like this:

                System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
                System.setProperty("java.naming.provider.url", "192.90.1.19:1099");

                Context context = new InitialContext();
                QueueConnectionFactory queueFactory =(QueueConnectionFactory)context.lookup("ConnectionFactory");

                • 5. Re: ConnectionFactory lookup
                  radazz

                  Hi!

                  I have the same problem under jboss 2.4.8 and above.
                  But under 2.4.4 external client works..

                  R.

                  • 6. Re: ConnectionFactory lookup
                    joelvogt

                    try this
                    props.put("java.naming.rmi.security.manager", "yes");
                    props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");

                    • 7. Re: ConnectionFactory lookup
                      sordes

                      We had the exact same problem not so long ago on one of my programmer's pc. It was fix by removing some conflicting jars from our classpath. Internally it was producing a marchaling error and for some reason the generated stub didn't complain about it and simply returned null.

                      Hope this will fix your problem as it did for us!