7 Replies Latest reply on Nov 4, 2013 11:20 AM by Justin Bertram

    Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance

    Raghavendra Venkatakrishnan Newbie

      Changes done:

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

      Modified hornetq-configuration.xml file with the below:

       

       

      hornetq-configuration.xml:

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

      for all connectors and acceptors:added the below params:

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

      <connectors>

            <connector name="netty">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

               <param key="host"  value="${hornetq_server_ip:135.xxx}"/>

               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

               <param key="ssl-enabled" value="true"/>

               <param key="key-store-path" value="${jboss.server.home.dir}/conf/keystore"/>

               <param key="key-store-password" value="changeit"/>

               <param key="use-nio" value="true" />

            </connector>

          

            <connector name="netty-throughput">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

               <param key="host"  value="${hornetq_server_ip:135.xx}"/>

               <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>

               <param key="ssl-enabled" value="true"/>

               <param key="key-store-path" value="${jboss.server.home.dir}/conf/keystore"/>

               <param key="key-store-password" value="changeit"/>

               <param key="batch-delay" value="50"/>

               <param key="use-nio" value="true" />

            </connector>

       

       

            <connector name="in-vm">

               <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>

               <param key="server-id" value="${hornetq.server-id:0}"/>

            </connector>

       

       

         </connectors>

       

       

         <acceptors>

            <acceptor name="netty">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

               <param key="host"  value="${hornetq_server_ip:135.xx}"/>

               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

               <param key="ssl-enabled" value="true"/>

               <param key="key-store-path" value="${jboss.server.home.dir}/conf/keystore"/>

               <param key="key-store-password" value="changeit"/>

               <param key="trust-store-path" value="${jboss.server.home.dir}/conf/keystore"/>

               <param key="trust-store-password" value="changeit"/>

            </acceptor>

          

            <acceptor name="netty-throughput">

               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

               <param key="host"  value="${hornetq_server_ip:135.xx}"/>

               <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>

               <param key="ssl-enabled" value="true"/>

               <param key="key-store-path" value="${jboss.server.home.dir}/conf/keystore"/>

               <param key="key-store-password" value="changeit"/>

               <param key="trust-store-path" value="${jboss.server.home.dir}/conf/keystore"/>

               <param key="trust-store-password" value="changeit"/>

               <param key="batch-delay" value="50"/>

               <param key="direct-deliver" value="false"/>

            </acceptor>

       

       

            <acceptor name="in-vm">

              <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>

              <param key="server-id" value="0"/>

            </acceptor>

       

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

      Exception:when I try to connect a remote JMS RMI client to above ssl enabled hornetq service:

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

      com.management.remote.RemoteJMXDispatcher logged : "could not register to event queue:

      javax.jms.JMSException: Failed to create session factory

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:114)

        ....

        ....

        ....

        Caused by: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

        at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:784)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)

        ... 11 more"

       

       

      com.platform.model.connection.ServerLink logged : "could not connect:

      java.lang.RuntimeException: javax.jms.JMSException: Failed to create session factory

            ...

            ...

            ...

      Caused by: javax.jms.JMSException: Failed to create session factory

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:114)

        ...

            ...

        ... 7 more

      Caused by: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

        at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:784)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)

        ... 11 more"

       

       

       

       

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

      hornetq:versions:

       

       

      <hornetq.version>2.2.20.EAP.GA</hornetq.version>

      <netty.version>3.2.3.Final</netty.version>

      <hornetq.integration.version>2.2.21.Final</hornetq.integration.version>

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

       

       

      Can anyone let me know how shall I resolve this and connect my remote jms client to ssl enabled hornetq jboss server?

       

      Is any version upgrade required to resolve the above?

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

       

      Thanks.

        • 1. Re: Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance
          Justin Bertram Master

          Please do not post the same question across multiple threads.

           

          Aside from that, I recommend you move to HornetQ 2.3.0.Final.  It has 2 important fixes for SSL - HORNETQ-408 and HORNETQ-1103.

          • 2. Re: Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance
            Raghavendra Venkatakrishnan Newbie

            My intention of posting across other two relevant threads was to get a quick response. Inconvenience regretted.

             

            Thanks Justin for the quick response.

             

            I am planning to migrate to HornetQ 2.3.0.Final only.

             

            My previous configuration in my pom.xml:

            hornetq:versions:

            <hornetq.version>2.2.20.EAP.GA</hornetq.version>

            <netty.version>3.2.3.Final</netty.version>

            <hornetq.integration.version>2.2.21.Final</hornetq.integration.version>

             

            Now iam planning to change the above:

            <hornetq.version>2.3.0.Final</hornetq.version>

            <netty.version>3.6.2.Final</netty.version>

            <hornetq.integration.version>2.2.21.Final</hornetq.integration.version>

             

            But can you let me know shall I put the same value of 2.3.0.Final even for hornetq.integration.version property.Will that be compatible in both compile and run time.Kindly provide your inputs.

             

            Cheers,

            Raghav

            • 3. Re: Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance
              Nayan Gohil Newbie

              Hi Justin/Raghav,

              I am working on JBoss EAP 6.1 and configuring JMS in domain mode.

              In domain.xml JMS configuration is like this

               

                         <connection-factory name="RemoteConnectionFactory">

                                          <connectors>

                                              <connector-ref connector-name="netty"/>

                                          </connectors>

                                          <entries>

                                              <entry name="RemoteConnectionFactory"/>

                                              <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>

                                          </entries>

                                          <ha>true</ha>

                                          <block-on-acknowledge>true</block-on-acknowledge>

                                          <retry-interval>1000</retry-interval>

                                          <retry-interval-multiplier>1.0</retry-interval-multiplier>

                                          <reconnect-attempts>-1</reconnect-attempts>

                </connection-factory>

               

              and destination is like

               

                                  <jms-destinations>  

                                      <jms-queue name="testQueue">

                                          <entry name="java:/queue/test"/>

                                          <entry name="java:jboss/exported/jms/queue/test"/>

                                          <durable>true</durable>

                                      </jms-queue>

                                  </jms-destinations>

              while doing as above getting error as below.Is something wrong in configuration.

              also i have no where coded or configured host=10-10-10-127. still getting this[parameters = {port=5445, host=10-10-10-127}] in error log.and this ip changes every time i restart the JBoss Server.let me know where i can check or override this dynamic HOST IP in configuration to make it static.

              .Thanks

               

              15:00:31,631 DEBUG [org.hornetq.core.server] (Thread-4 (HornetQ-server-HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a-1188286789)) Connecting  ClusterConnectionBridge@6f71cb85 [name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, queue=QueueImpl[name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a]]@17e8c1ec targetConnector=ServerLocatorImpl (identity=(Cluster-connection-bridge::ClusterConnectionBridge@6f71cb85 [name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, queue=QueueImpl[name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a]]@17e8c1ec targetConnector=ServerLocatorImpl [initialConnectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=10-10-10-127], discoveryGroupConfiguration=null]]::ClusterConnectionImpl@2122146079[nodeUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a, connector=TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=10-10-10-1, address=jms, server=HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a])) [initialConnectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=10-10-10-127], discoveryGroupConfiguration=null]] to its destination [a4f17244-3d58-11e3-8c89-87263e6e5c8a], csf=null

              15:00:31,631 DEBUG [org.hornetq.core.client] (Thread-4 (HornetQ-server-HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a-1188286789)) Trying to connect with connector = org.hornetq.core.remoting.impl.netty.NettyConnectorFactory@16c7d858, parameters = {port=5445, host=10-10-10-127} connector = NettyConnector [host=10-10-10-127, port=5445, httpEnabled=false, useServlet=false, servletPath=/messaging/HornetQServlet, sslEnabled=false, useNio=false]

              15:00:31,631 DEBUG [org.hornetq.core.client] (Thread-4 (HornetQ-server-HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a-1188286789)) Started Netty Connector version 3.6.2.Final-redhat-1-c0d783c

              15:00:31,631 DEBUG [org.hornetq.core.client] (Thread-4 (HornetQ-server-HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a-1188286789)) Remote destination: /10-10-10-127:5445

              15:00:31,632 DEBUG [org.hornetq.core.client] (Thread-4 (HornetQ-server-HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a-1188286789)) Could not connect to any server. Didn't have reconnection configured on the ClientSessionFactory

              15:00:31,632 DEBUG [org.hornetq.core.server] (Thread-4 (HornetQ-server-HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a-1188286789)) Bridge ClusterConnectionBridge@6f71cb85 [name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, queue=QueueImpl[name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a]]@17e8c1ec targetConnector=ServerLocatorImpl (identity=(Cluster-connection-bridge::ClusterConnectionBridge@6f71cb85 [name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, queue=QueueImpl[name=sf.my-cluster.ad5e4c73-40a0-11e3-b260-75e53c38159b, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a]]@17e8c1ec targetConnector=ServerLocatorImpl [initialConnectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=10-10-10-127], discoveryGroupConfiguration=null]]::ClusterConnectionImpl@2122146079[nodeUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a, connector=TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=10-10-10-1, address=jms, server=HornetQServerImpl::serverUUID=a4f17244-3d58-11e3-8c89-87263e6e5c8a])) [initialConnectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=10-10-10-127], discoveryGroupConfiguration=null]] is unable to connect to destination. Retrying: HornetQException[errorType=NOT_CONNECTED message=Unable to connect to server using configuration TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=10-10-10-127]

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.connect(ClientSessionFactoryImpl.java:256) [hornetq-core-client-2.3.1.Final-redhat-1.jar:2.3.1.Final-redhat-1]

                at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:694) [hornetq-core-client-2.3.1.Final-redhat-1.jar:2.3.1.Final-redhat-1]

                at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:650) [hornetq-core-client-2.3.1.Final-redhat-1.jar:2.3.1.Final-redhat-1]

                at org.hornetq.core.server.cluster.impl.ClusterConnectionBridge.createSessionFactory(ClusterConnectionBridge.java:150) [hornetq-server-2.3.1.Final-redhat-1.jar:2.3.1.Final-redhat-1]

                at org.hornetq.core.server.cluster.impl.BridgeImpl.connect(BridgeImpl.java:800) [hornetq-server-2.3.1.Final-redhat-1.jar:2.3.1.Final-redhat-1]

                at org.hornetq.core.server.cluster.impl.BridgeImpl$ConnectRunnable.run(BridgeImpl.java:1106) [hornetq-server-2.3.1.Final-redhat-1.jar:2.3.1.Final-redhat-1]

                at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:106) [hornetq-core-client-2.3.1.Final-redhat-1.jar:2.3.1.Final-redhat-1]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_24]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_24]

                at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

              • 4. Re: Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance
                Justin Bertram Master

                I'm not familiar with "hornetq.integration.version".  What exactly is that for?

                • 5. Re: Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance
                  Justin Bertram Master

                  As far as I can tell your question has nothing to do with this thread.  Please start a new thread with your question.  Also, please try to format your text so it's easier to read (hint: click "Use advanced editor").

                  • 6. Re: Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance
                    Raghavendra Venkatakrishnan Newbie

                    Justin,

                     

                    I believe it is related to making hornetq integrate with other softwares in the container like spring, twitter using the binary specified in this integration version tag.

                    • 7. Re: Issue in connecting jms RMI client to ssl enabled hornetq jboss server instance
                      Justin Bertram Master

                      I still don't know what that is, and how exactly it is being used by whatever needs it to be set.