11 Replies Latest reply on Mar 9, 2004 11:03 PM by raja_chakraborty

    TopicConnectionFactory not bound !

    raja_chakraborty Newbie

      Hi,
      I am facing this particular problem since a long time, unfortunately came across this forum just few days back. However, I couldnot find solution to this patent problem.
      I was trying to use JMS in JBoss server and when I tried to run my target from the build.xml file, I get this exception always.

      "javax.naming.NameNotFoundException: TopicConnectionFactory not bound"


      For your reference I am using the jndi.properties file which has :
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=localhost:1099
      java.naming.factory.url.pkgs=org.jnp.interfaces


      I dont think I need to create a new TopicConnectionfactory in JBoss?
      Can anyone pls tell me why this exception could be thrown?
      Kindly help me on this exception and how to remove this.
      Thanks...
      Biswajit.


        • 1. Re: TopicConnectionFactory not bound !
          Elias Ross Master


          Post the code you're using to connect with, explain when you're using that code. Is it within JBoss or the client? Assuming you're using a client: Go the jmx-console and see if the JNDI object is printed in the JNDI tree. I think you want to lookup "ConnectionFactory" in JNDI and cast it. Adrian recommends UIL2ConnectionFactory.

          • 2. Re: TopicConnectionFactory not bound !
            raja_chakraborty Newbie

            Hi Genman,

            I am using the code samples from documentation-example.zip I downloaded from this site. Anyway, I am writing down the code I am using which is throwing the exception...

             /**
             * Sets up all the JMS fixtures.
             *
             * Use close() when finished with object.
             *
             * @param factoryJNDI name of the topic connection factory to look up.
             * @param topicJNDI name of the topic destination to look up
             */
             public HelloPublisher(String factoryJNDI, String topicJNDI)
             throws JMSException, NamingException {
            
             // Get the initial context
             Context context = new InitialContext();
            
             // Get the connection factory, here
             // factoryJNDI is TopicConnectionFactory
             // which I am passing from the main method. Exception is here.
             TopicConnectionFactory topicFactory =
             (TopicConnectionFactory)context.lookup(factoryJNDI);
            
             // Create the connection
             topicConnection = topicFactory.createTopicConnection();
            
             // Create the session
             topicSession = topicConnection.createTopicSession(
             // No transaction
             false,
             // Auto ack
             Session.AUTO_ACKNOWLEDGE);
            
             // Look up the destination
             // Here topicJNDI is the Topic I have
             // created in the file "jboss.jcml". I pass
             // this from the main method.
             topic = (Topic)context.lookup(topicJNDI);
            
             // Create a publisher
             topicPublisher = topicSession.createPublisher(topic);
            
             }
            


            The jndi.properties file I use is :
            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.naming.provider.url=localhost:1099
            java.naming.factory.url.pkgs=org.jnp.interfaces
            
            .

            The above Java code is the client code. I run this file from the console and I get this exception then.

            Thanks and will be waiting for your response.
            Biswajit.



            • 3. Re: TopicConnectionFactory not bound !
              Adrian Brock Master

              Those examples apply to 2.4.x
              Use UIL2ConnectionFactory

              Try the getting started guide it is much more up-to-date.

              Regards,
              Adrian

              • 4. Re: TopicConnectionFactory not bound !
                raja_chakraborty Newbie

                Hi Adrian,

                Can you please tell me to run these examples do I need to run both the JBoss server as well as the JBossMQ separately?
                I am asking you this because, if I run the JBoss server first and then run the JBossMQ later, it throws this exception saying that the NamingService couldnot be started at 1099 port. I think this is because this same port is also used by the JBoss server which I am starting first.

                Also I am still getting the same exception of "TopicConnectionFactory not bound" evenif I use JBoss 2.4.10 version.

                Please reply.
                thanks
                Biswajit.

                • 5. Re: TopicConnectionFactory not bound !
                  raja_chakraborty Newbie

                  Adrian,

                  Finally I wanted to ask if there is any file where we need to enter our JNDI mapping names for the TopicConnectionFactory or any resource we are using?

                  thanks
                  Biswajit.

                  • 6. Re: TopicConnectionFactory not bound !
                    Adrian Brock Master

                    The name should be ConnectionFactory in 2.4
                    I don't remember those examples, use grep to locate where it says TopicConnectionFactory
                    and change it.

                    JBossMQ was pretty bad in 2.4 (still beta software)

                    Regards,
                    Adrian

                    • 7. Re: TopicConnectionFactory not bound !
                      raja_chakraborty Newbie

                      Adrian,

                      I am using JBoss 3.2.3 and JBossMQ 1.0.0-Beta-1. Do I still need to use ConnectionFactory instead of the TopicConnectionfactory? Are these 2 versions compatible with each other?
                      Also, can you please tell me do I need to run both the JBoss server as well as the JBossMQ separately to use JMS with JBoss?
                      I am asking you this because, if I run the JBoss server first and then run the JBossMQ later, it throws this exception saying that the NamingService couldnot be started at 1099 port. I think this is because this same port is also used by the JBoss server which I am starting first.

                      thanks and regds,
                      Biswajit.

                      • 8. Re: TopicConnectionFactory not bound !
                        Adrian Brock Master

                        You cannot run both together without changing port bindings.

                        Why are you running jbossmq-1.0beta?
                        JBoss-3.2.3 includes the much better JBossMQ-3.2

                        Regards,
                        Adrian

                        • 9. Re: TopicConnectionFactory not bound !
                          raja_chakraborty Newbie

                          Adrian,

                          Yes I realized that JBoss 3.2.3 runs the JBossMQ 3.2 on its own.
                          Another thing I noticed was that when I was running the JBoss 3.2.3 server, I checked the server.log file under
                          C:\JBoss\jboss-3.2.3\server\default\log and I saw that the WebServer was running on 8083.
                          The message displayed on the server.log file was this :

                          2004-03-09 11:11:48,263 INFO [org.jboss.web.WebService] Started WebServer with address: 0.0.0.0:8083

                          Now when i went to the browser and typed
                          http://localhost:8083/jmx-console/index.html
                          it displayed a blank page, not the JMX Console atall.

                          I thought the JBoss server runs on port 8080 default, but the JMX Console is not shown even on port 8080.
                          Can you please explain why am I not displayed the JMX Console?

                          thanks n regds,
                          Biswajit.


                          • 10. Re: TopicConnectionFactory not bound !
                            Adrian Brock Master

                            8083 is the webserver for RMI classloading

                            Regards,
                            Adrian

                            • 11. Re: TopicConnectionFactory not bound !
                              raja_chakraborty Newbie

                              Thanks Adrian...
                              Now when i went to the browser and typed

                              http://localhost:8083/jmx-console/index.html

                              it displayed a blank page, not the JMX Console atall.

                              I have tried using the same with port 8080 also, but it showed a blank page again.Can you please explain why am I not displayed the JMX Console?
                              regds,
                              Biswajit.