11 Replies Latest reply on Nov 27, 2014 7:47 AM by crazycradd

    Problem connecting to jms topic when using https

    crazycradd

      I have ported my app from Jboss 7 to wildfly and all works well when using http.

       

      I have set up a new server to test the ssl configuration the https connection seems to work fine from a web point of view and I can also connect via remote ejb client so all looks good.

       

      The only problem I have is that the JMS Topic will not connect.

       

      I have had a look at the schema and you do not seem to have a https-connector I can set up so I tried altering the binding to use https but this still fails.

       

                 <http-connector name="http-connector" socket-binding="http">
                    <param key="http-upgrade-endpoint" value="http-acceptor"/>
                 </http-connector>
                 <http-connector name="http-connector-throughput" socket-binding="http">
                    <param key="http-upgrade-endpoint" value="http-acceptor-throughput"/>
                    <param key="batch-delay" value="50"/>
                 </http-connector>

       

       

      My remote client connect using the following context properties.

       

      java.naming.provider.url=http-remoting://x2100a.coa.local:11171,https-remoting://x2100a.coa.local:11171

      java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory

      java.naming.security.authentication=simple

      java.naming.security.principal=admin

      jboss.naming.client.ejb.context=true

      java.naming.security.credentials=password

        • 1. Re: Problem connecting to jms topic when using https
          jmesnil

          peter craddock wrote:

          The only problem I have is that the JMS Topic will not connect.

           

          I have had a look at the schema and you do not seem to have a https-connector I can set up so I tried altering the binding to use https but this still fails.

           

                    <http-connector name="http-connector" socket-binding="http">
                       <param key="http-upgrade-endpoint" value="http-acceptor"/>
                    </http-connector>
                   

          You should also modify the corresponding http-acceptor accordingly so that it uses the https-listener that you added to the undertow subsystem.

          • 2. Re: Problem connecting to jms topic when using https
            crazycradd

            Here is the jms config

             

                    <connectors>
                       <http-connector name="http-connector" socket-binding="https">
                          <param key="http-upgrade-endpoint" value="http-acceptor"/>
                       </http-connector>
                       <http-connector name="http-connector-throughput" socket-binding="http">
                          <param key="http-upgrade-endpoint" value="http-acceptor-throughput"/>
                          <param key="batch-delay" value="50"/>
                       </http-connector>
                       <in-vm-connector name="in-vm" server-id="0"/>
                    </connectors>
                    <acceptors>
                       <http-acceptor http-listener="default" name="http-acceptor"/>
                       <http-acceptor http-listener="default" name="http-acceptor-throughput">
                          <param key="batch-delay" value="50"/>
                          <param key="direct-deliver" value="false"/>
                       </http-acceptor>
                       <in-vm-acceptor name="in-vm" server-id="0"/>
                    </acceptors>

             

             

            And here is the undertow listerners, I made the https listener the default so I think the acceptor is correct

             

                 <server name="default-server">
                    <http-listener name="local" socket-binding="http"/>
                    <host alias="localhost" name="default-host">
                       <location handler="welcome-content" name="/wildfly"/>
                       <filter-ref name="server-header"/>
                       <filter-ref name="x-powered-by-header"/>
                    </host>
                    <https-listener name="default" security-realm="ssl-realm" socket-binding="https"/>
                 </server>
            • 3. Re: Problem connecting to jms topic when using https
              jmesnil

              What is the error you have? Can you past the server and client logs so that I can have more information on your problem?

              • 4. Re: Problem connecting to jms topic when using https
                crazycradd

                Here is the client error

                 

                10:39:13,372 ERROR [EntityEventWatcher] failed to start jms com.cedar.cp.api.base.CPException: can't create topic entityEventTopic

                javax.jms.JMSException: Failed to create session factory

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

                    at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:193)

                    at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:188)

                    at com.cedar.cp.util.common.JmsConnectionImpl$AbstractJmsTopic.<init>(JmsConnectionImpl.java:289)

                    at com.cedar.cp.util.common.JmsConnectionImpl$JmsTopicSubscriber.<init>(JmsConnectionImpl.java:416)

                    at com.cedar.cp.util.common.JmsConnectionImpl.<init>(JmsConnectionImpl.java:36)

                    at com.cedar.cp.impl.base.CPConnectionImpl.getJmsConnection(CPConnectionImpl.java:437)

                    at com.cedar.cp.impl.base.EntityEventWatcher.init(EntityEventWatcher.java:30)

                    at com.cedar.cp.impl.base.EntityEventWatcher.access$200(EntityEventWatcher.java:10)

                    at com.cedar.cp.impl.base.EntityEventWatcher$1.run(EntityEventWatcher.java:57)

                Caused by: HornetQNotConnectedException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.]

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

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

                    ... 9 more

                com.cedar.cp.api.base.CPException: can't create topic entityEventTopic

                    at com.cedar.cp.util.common.JmsConnectionImpl$AbstractJmsTopic.<init>(JmsConnectionImpl.java:299)

                    at com.cedar.cp.util.common.JmsConnectionImpl$JmsTopicSubscriber.<init>(JmsConnectionImpl.java:416)

                    at com.cedar.cp.util.common.JmsConnectionImpl.<init>(JmsConnectionImpl.java:36)

                    at com.cedar.cp.impl.base.CPConnectionImpl.getJmsConnection(CPConnectionImpl.java:437)

                    at com.cedar.cp.impl.base.EntityEventWatcher.init(EntityEventWatcher.java:30)

                    at com.cedar.cp.impl.base.EntityEventWatcher.access$200(EntityEventWatcher.java:10)

                    at com.cedar.cp.impl.base.EntityEventWatcher$1.run(EntityEventWatcher.java:57)

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

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

                    at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:193)

                    at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:188)

                    at com.cedar.cp.util.common.JmsConnectionImpl$AbstractJmsTopic.<init>(JmsConnectionImpl.java:289)

                    ... 6 more

                Caused by: HornetQNotConnectedException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.]

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

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

                    ... 9 more

                 

                No error on the server at this point.

                 

                If I log onto the web pages and do some work I get no error either so I suspect the web tier is connecting correctly (I will check this further but it appears to be ok at this point).

                • 5. Re: Problem connecting to jms topic when using https
                  jmesnil

                  I reproduced your use case and I confirm there is an issue with using http-upgrade and https with HornetQ. [HORNETQ-1317] Error connecting with http-upgrade mechanism against https port on WildFly - JBoss Issue Tracker was open some times ago and looks to be similar to the issue you are facing.

                  • 6. Re: Problem connecting to jms topic when using https
                    crazycradd

                    I have just downloaded 8.1 and the problem still seems to exist, do I need to alter the config to get this to work

                    • 7. Re: Problem connecting to jms topic when using https
                      markusschwarz

                      Hi,

                      is this solved now? Because as you already imagine I'm facing the same problem.

                      Do we have to upgrade to HornetQ 2.4.2.FINAL in order to get it work in Wildfly 8.1.0.FINAL or is it a configuration problem?

                      Regards, Markus

                      • 8. Re: Problem connecting to jms topic when using https
                        ks-appendium

                        Hi,

                        Has anyone been able to solve this? I have tried to replace hornetq with hornetq 2.4.3.Final in wildfly installation and still getting an error.

                         

                        Thanks

                        • 9. Re: Problem connecting to jms topic when using https
                          crazycradd

                          I have chased this up recently and the Jira issue Jeff has added a link to above has been resolved.

                           

                          The problem is the Jira log was resolved before wildfly 8.1 was released and the issue was still in 8.1.

                           

                          8.2 is getting ready to release so I have been in touch with the wildfy and hornetq developers to find out if this will be included in that release. Once I have an answer I will update this thread.

                          • 10. Re: Problem connecting to jms topic when using https
                            ks-appendium

                            Hi,

                            Saw this jira [WFLY-3658] Upgrade HornetQ to 2.4.3.Final - JBoss Issue Tracker but it is done only for Wildfly 9 branch. On 8.x branch as at 18/9 it is still using hornetq 2.4.1.Final. @jeffmesnil can we please backport this to 8.x branch? Thanks


                            I doubt this is the problem however as I have replaced the hornetq version from 2.4.1.Final to 2.4.3.Final in 8.1.0.Final to use and had the same issue. It looks like the problem is when it is trying to retrieve a jmsConnectionFactory using https.


                            Is there a working quickstart guide that can be followed to get jms on https working?


                            Thanks

                             




                            • 11. Re: Problem connecting to jms topic when using https
                              crazycradd

                              I also get the same problem in wildfly 8.2 and in the wildfly 9 nightly build I have raised this Wildfly 8.2 JMS Topic connection over https to see if I can get clarification.