7 Replies Latest reply on Jul 5, 2010 4:14 PM by ron_sigal

    Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3

    prabhun

      Hi,

       

      We were using JBoss MQ with JBoss 4.2.3. Now we have replaced JBoss MQ with JBoss Messaging by going through the migration instructions provided in the JBoss User guides.

       

      We have a number of Client systems (Java Swing based Reports) who were subscribed to the JMS (MQ implementation) in JBoss 4.2.3. Whenever a message arrives to the 'JBoss server TOPIC' all clients will receive that message. Message is sent by Oracle to JBoss server TOPIC through webservice call.

       

      Now as we have replaced MQ with Messaging, I would like to know what are all the configurations I should take care for the above scenario to work.

       

      We have the following Environment details:

       

      JBoss server : 4.2.3

      JBoss Messaging: 1.4.2.GA-SP1

      JBoss Remoting: 2.2.2.SP8

       

       

      I have gone through the documents/guides and setup the following.

       

      1. Server side setup:

       

      connection-factories-service.xml

       

      Add the below entry to the above file (attached)

      mbean code - name="jboss.messaging.connectionfactory:service=CyrusConnectionFactory"

       

      Added the below entries to remoting-bisocket-service.xml file (attached)

      <attribute name="secondaryBindPort">14000</attribute>                          
      <attribute name="secondaryConnectPort">14001</attribute>

       

      2. Client side setup:

       

      Our client code which receives the message from TOPIC is in JMSTopicClient.java (attached)

       

      I have the following jars on the client side class path:

       

      jboss-messaging-client.jar

      jboss-remoting.jar

      jbossall-client.jar

      jboss-aop-jdk50.jar

      javassist.jar

      trove.jar          

       

      Now when I invoke the client I get the following exceptions:

       

      First exception:

       

      4047 [main] TRACE  org.jboss.util.propertyeditor.PropertyEditors  -  Mapping properties for  bean: SocketClientInvoker[b988a6,  bisocket://uktapp02.tui.de:4457]
      4047 [main] TRACE  org.jboss.util.propertyeditor.PropertyEditors  -  Property editor found  for: pingFrequency, editor:  java.beans.PropertyDescriptor@d49b6d85,  setter: public void   org.jboss.remoting.transport.bisocket.BisocketClientInvoker.setPingFrequency(int)
      4047 [main] TRACE org.jboss.util.propertyeditor.PropertyEditors  -   Property editor found for: numberOfCallRetries, editor:   java.beans.PropertyDescriptor@b82b85fb, setter: public void   org.jboss.remoting.transport.socket.MicroSocketClientInvoker.setNumberOfCallRetries(int)
      4047 [main] TRACE org.jboss.util.propertyeditor.PropertyEditors  -   Property editor found for: marshaller, editor:   java.beans.PropertyDescriptor@4ebe59ab, setter: public void   org.jboss.remoting.MicroRemoteClientInvoker.setMarshaller(org.jboss.remoting.marshal.Marshaller)
      4047 [main] TRACE org.jboss.util.propertyeditor.PropertyEditors  -   Failed to find property editor for: marshaller
      4047 [main] TRACE  org.jboss.util.propertyeditor.PropertyEditors  -  Failed to write  property
      java.lang.NullPointerException
           at   org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(PropertyEditors.java:373)
           at   org.jboss.remoting.transport.socket.MicroSocketClientInvoker.setup(MicroSocketClientInvoker.java:405)

       

       

       

      Second exception:

       

      25048 [main] ERROR org.jboss.jms.client.JBossConnectionFactory  - Failed to download and/or install client side AOP stack
      org.jboss.jms.exception.MessagingNetworkFailureException
          at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:240)
          at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:205)

       

       

      Caused by: org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://uktapp02.tui.de:4457//?JBM_clientMaxPoolSize=200&clientLeasePeriod=10000&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowFactor=10&socket.check_connection=false&stopLeaseOnFailure=true&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat&validatorPingPeriod=10000&validatorPingTimeout=5000]
          at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:579)

       

       

      I would like to know if I am missing anything here and how to resolve the above exceptions and make messaging work?

       

       

      Thanks

       

      Prabhu

        • 1. Re: Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3
          ron_sigal

          Hi Prabu,

           

          1) You can ignore the NullPointerException.  Note that it is logged at TRACE level.

           

          2) I don't know why you're getting the CannotConnectException.  Look in $JBOSS_HOME/server/$CONFIG/log/server.log to make sure JBossMessaging started up properly.  And make sure there's an open port at uktapp02.tui.de:4457.

           

          3) By the way, are you sure you want to set "secondaryConnectPort"?  Setting "secondaryBindPort" will determine the port used by the bisocket transport's secondary ServerSocket. Setting "secondaryConnectPort" determines the port that will be used by the client to connect to the secondary ServerSocket.  Unless you have some kind of port translation set up, these values should be the same and you don't need to set "secondaryConnectPort."

           

          -Ron

          • 2. Re: Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3
            prabhun

            Hi Ron,

             

            Thanks for your reply.

             

            I did some more analysis.

             

            I setup the JBoss server locally in my system and tried conencting with JMSClient. There are no errors and message is posted to server TOPIC.

             

            I forgot to mention that I tested from my client setup in Bangalore, India office and my JBoss server is runing in a solaris box in UK.

             

            So I setup the client in one of the UK windows box and tried the same execise, now I get a different error as below

             

            ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

             

            2010-05-28 16:15:21,292 ERROR org.jboss.remoting.transport.bisocket.BisocketServerInvoker [] - unable to create control connection after 10 retries
            java.net.ConnectException: Connection timed out: connect
                at java.net.PlainSocketImpl.socketConnect(Native Method)
                at java.net.PlainSocketImpl.doConnect(Unknown Source)
                at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
                at java.net.PlainSocketImpl.connect(Unknown Source)
                at java.net.SocksSocketImpl.connect(Unknown Source)
                at java.net.Socket.connect(Unknown Source)
                at java.net.Socket.connect(Unknown Source)
                at java.net.Socket.<init>(Unknown Source)
                at java.net.Socket.<init>(Unknown Source)
                at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:258)
                at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:407)
                at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
                at org.jboss.remoting.Client.invoke(Client.java:1634)
                at org.jboss.remoting.Client.addCallbackListener(Client.java:1703)
                at org.jboss.remoting.Client.addListener(Client.java:921)
                at org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)
                at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:375)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:158)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
                at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)
                at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
                at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
                at org.jboss.jms.client.JBossConnectionFactory.createTopicConnection(JBossConnectionFactory.java:115)
                at org.jboss.jms.client.JBossConnectionFactory.createTopicConnection(JBossConnectionFactory.java:109)
                at org.jnexus.plugins.jms.JMSTopicClient.subscribe(JMSTopicClient.java:164)
                at org.jnexus.plugins.jms.dom.JMSTopic.performConnect(JMSTopic.java:210)
                at org.jnexus.plugins.jms.dom.JMSTopic.access$000(JMSTopic.java:30)
                at org.jnexus.plugins.jms.dom.JMSTopic$1.run(JMSTopic.java:140)
                at java.lang.Thread.run(Unknown Source)
            2010-05-28 16:15:21,479 ERROR org.jnexus.plugins.jms.dom.JMSTopic [] - JMS: Connection to /acme/MyExampleConnectionFactory topic/CyrusWorkstationTopic failed.
            org.jboss.jms.exception.MessagingNetworkFailureException
                at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:245)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:191)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
                at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)
                at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
                at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
                at org.jboss.jms.client.JBossConnectionFactory.createTopicConnection(JBossConnectionFactory.java:115)
                at org.jboss.jms.client.JBossConnectionFactory.createTopicConnection(JBossConnectionFactory.java:109)
                at org.jnexus.plugins.jms.JMSTopicClient.subscribe(JMSTopicClient.java:164)
                at org.jnexus.plugins.jms.dom.JMSTopic.performConnect(JMSTopic.java:210)
                at org.jnexus.plugins.jms.dom.JMSTopic.access$000(JMSTopic.java:30)
                at org.jnexus.plugins.jms.dom.JMSTopic$1.run(JMSTopic.java:140)
                at java.lang.Thread.run(Unknown Source)
            Caused by: java.net.ConnectException: Connection timed out: connect
                at java.net.PlainSocketImpl.socketConnect(Native Method)
                at java.net.PlainSocketImpl.doConnect(Unknown Source)
                at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
                at java.net.PlainSocketImpl.connect(Unknown Source)
                at java.net.SocksSocketImpl.connect(Unknown Source)
                at java.net.Socket.connect(Unknown Source)
                at java.net.Socket.connect(Unknown Source)
                at java.net.Socket.<init>(Unknown Source)
                at java.net.Socket.<init>(Unknown Source)
                at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:258)
                at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:407)
                at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
                at org.jboss.remoting.Client.invoke(Client.java:1634)
                at org.jboss.remoting.Client.addCallbackListener(Client.java:1703)
                at org.jboss.remoting.Client.addListener(Client.java:921)
                at org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)
                at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:375)
                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:158)
                ... 13 more

             

            ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

             

            Also as you have suggested, I removed the entry 'secondaryConnectPort' from the remoting-bisocket-service.xml file and kept only the below entry

             

            <attribute name="secondaryBindPort">14000</attribute>

             

            Is any other setting required to avoid this error?

             

            And I think the error which I reported earlier may be due to a firewall between my Bangalore box and UK box

             

            Regards,

             

            Prabhu

            • 3. Re: Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3
              ron_sigal

              Hi Prabhu,

               

              Well, you're making progress.  The new exception indicates that you're making a "primary" connection, and failing on the "secondary" connection.  The details don't matter, but the bisocket transport will connect from the client to two different ServerSockets on the server, and you're failing to connection to the secondary ServerSocket.

               

               

              And I think the error which I reported earlier may be due to a firewall between my Bangalore box and UK box

               

               

               

              In fact, the attribute I suggested taking out, "secondaryConnectPort," is relevant to connection in the presence of a firewall. If the firewall is doing address  (and, in particular, port)  translation, it could be that you need to connect to a port different from the one the secondary ServerSocket is bound to.  I would check that out next.

               

              -Ron

              • 4. Re: Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3
                prabhun

                Hi Ron,

                 

                Sorry, I was busy chasing for the ports to get opened from service personnel.

                 

                I could get the following ports opened for testing from my system (Bangalore) to JBoss server (UK) as there is a Firewall

                 

                4457 - serverBindPort

                14000 - secondaryBindPort

                14001 - secondaryConnectPort

                 

                However I got the same error as below

                 

                2010-06-03 20:18:23,709 ERROR org.jboss.remoting.transport.bisocket.BisocketServ
                erInvoker [] - unable to create control connection after 10 retries
                java.net.ConnectException: Connection refused: connect
                        at java.net.PlainSocketImpl.socketConnect(Native Method)
                        at java.net.PlainSocketImpl.doConnect(Unknown Source)
                        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
                        at java.net.PlainSocketImpl.connect(Unknown Source)
                        at java.net.SocksSocketImpl.connect(Unknown Source)
                        at java.net.Socket.connect(Unknown Source)
                        at java.net.Socket.connect(Unknown Source)
                        at java.net.Socket.<init>(Unknown Source)
                        at java.net.Socket.<init>(Unknown Source)

                 

                 

                Then I did the following,

                 

                Tried a telnet command from my box for 4457, 14000 and 14001. The telnet opened only for 4457 and 14000 and not for 14001.

                 

                And I found that the JBoss Server is not listening at all on the 14001 port.

                 

                netstat -an|grep 4457,  gave me,

                 

                *.4457               *.*                0      0 49152      0 LISTEN

                 

                and netstat -an|grep 14000, gave me,

                 

                *.14000              *.*                0      0 49152      0 LISTEN

                 

                But for 14001 there is no result.

                 

                Any thoughts?

                 

                Thanks,

                 

                Prabhu

                • 5. Re: Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3
                  prabhun

                  Excellant,

                   

                  Thanks Mike, it works now. I changed both attributes to 14000 and that did the trick.

                   

                  Thanks Ron for your help and for the clear explanation.

                   

                  Cheers,

                  Prabhu

                   

                  P.S: I could see Mike's reply only once and could not see now, when I click the link (Mike's reply) from my inbox it says 'page not found' I am not sure how his reply message got deleted from this forum?

                  • 6. Re: Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3
                    mikemil

                    The reason you couldn't see my reply was because I deleted my response after going back and re-reading the whole thread, which I didn't do before posting a quick response.   After reading the thread, I think I saw Ron also suggest the same thing and didn't want to be intruding especially if I was providing the same advice you received previously. 

                     

                    Any way, glad to year your hare working now!

                    • 7. Re: Need help in configuring JMS with JBoss Messaging in JBoss 4.2.3
                      ron_sigal

                      Hey Mike,

                       

                      After reading the thread, I think I saw Ron also suggest the same thing  and didn't want to be intruding especially if I was providing the same  advice you received previously.

                       

                      Please intrude all you want. 

                       

                      Seriously, I'm always happy when other people contribute.  And I'm happy to cede credit.  Go for it. 

                       

                      Resurrecting Mike's answer:

                       

                      Pardon me for butting in - and take this for what its worth:  I remember reading one of Ron's responses to someone else - unless you have some firewall code mapping port 14000 to 14001, then you don't really need to configure the secondaryConnectPort or you can set both parms to the same value - 14000.

                       

                      -Ron