4 Replies Latest reply on Aug 22, 2002 9:57 AM by jeff kramer

    TopicConnectionFactory questions

    jeff kramer Newbie


      Running jboss3.0/nt4

      I have a simple chat program that is giving me a TopicConnectionFactory not bound error.

      I'm trying to build a more complex jbossMQ project & am just trying to get rolling..

      Some more info is I am able to run a similar program that uses a QueueConnectionFactory.

      With these simple programs, I just compiled the .class files, jar'd them up & dropped them into the ../default/deploy directory. I see the server picks them up.

      I have no associated .xml files

      I'm not sure about which .jar files to put in the classpath.. At the moment I have all the jboss-3.0.0\lib\.jar's

      the following additional .jar files:


      Obviously, there are more, and a client directory of jars..

      Can anyone advise me which to include, or offer any other solution to this problem?

      I have hunted through the posts & a few refer to updating various .xml files, although none seemed to correspond to what I have in jboss-3.0.0

      Thanks very much,


        • 1. Re: TopicConnectionFactory questions
          Joel Vogt Master

          can you post the way you are trying to look up the connection factory and the error generated?

          • 2. Re: TopicConnectionFactory questions
            Lars-Inge Tønnessen Newbie

            Jeff Kramer,

            I asume you are looking at the JBoss 2.4 docs and are running the JBoss 3.x server....

            Try to connect to the "java:/ConnectionFactory" for both Queue and Topic in the JBoss 3.0.0.

            • 3. Re: TopicConnectionFactory questions
              jeff kramer Newbie

              joelvogt -

              It's failing on this line:

              TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("TopicConnectionFactory");

              and here is the error:

              D:\jboss>java Chat topic user s
              javax.naming.NameNotFoundException: TopicConnectionFactory not bound
              at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
              at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
              at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
              at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:445)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
              at javax.naming.InitialContext.lookup(InitialContext.java:350)
              at Chat.(Chat.java:38)
              at Chat.main(Chat.java:125)

              here's the code in context of the program:

              //Obtain a JNDI connection
              Properties env = new Properties();

              //... specify JNDI properties specific to the vendor
              env.put( Context.PROVIDER_URL, "jnp://localhost:1099" );
              env.put( Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" );
              env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );

              Context jndi = new InitialContext(env);

              // Look up a JMS connection factory

              TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("TopicConnectionFactory");

              //Create a JMS conn
              TopicConnection connection = conFactory.createTopicConnection(username, password);

              Thanks for your interest,


              • 4. Re: TopicConnectionFactory questions
                jeff kramer Newbie

                larsinge -

                Yes, I'm using jboss 3.0.0 & have the jboss admin & development book covering 2.x

                I'm afraid I am not that clear on your suggestion.
                I think you mean instead of:

                TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("TopicConnectionFactory");


                TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("ConnectionFactory");

                With the change I now get this error:

                D:\jboss>java Chat topic jeff x
                log4j:WARN No appenders could be found for logger (org.jboss.mq.referenceable.Sp
                log4j:WARN Please initialize the log4j system properly.
                javax.jms.JMSSecurityException: User: jeff is NOT authenticated
                <<no stack trace available>>

                This looks a little better I think, but still not working..

                I have the \jboss-3.0.0\server\all\lib\log4j.jar;
                in the classpath..

                any further ideas?