7 Replies Latest reply on Nov 28, 2014 4:55 AM by sreckom

    How to connect java 1.6 JMS client to WildFly 8.1 final?

    sreckom

      Hello to everyone.

       

      I have a problem trying to get JMS client running on java 1.6 to connect to WildFly 8.1. I tried to use jboss-client.jar, included in wildfly 8.1 distribution, but hornetq classes are compiled with java 1.7, so I get an error

      Caused by: java.lang.UnsupportedClassVersionError: org/hornetq/jms/client/HornetQJMSConnectionFactory : Unsupported major.minor version 51.0

      I've tried to use jboss-client.jar which comes with EAP 6.2 (implementation version inside MANIFEST.MF says 7.3.0.Final-redhat-14), but this doesn't work for me. I get this exception:

      Caused by: java.lang.IllegalStateException: The following keys are invalid for configuring a connector: http-upgrade-endpoint, http-upgrade-enabled

          at org.hornetq.core.client.impl.ClientSessionFactoryImpl.checkTransportKeys(ClientSessionFactoryImpl.java:1504)

      I enabled old remoting port (I added remoting port to socket binding and remoting-connector to remoting subsystem). I connected the old client with remoting://localhost:4447 to the server. Initial context is created, connection factory is looked up ok, but createQueueConnection on QueueConnectionFactory fails. with illegal state exception.I figure that wildfly still sends those http-upgrade transports to the old client. What do I need to do to prevent this?

      Thank you in advance for the answers.

       

      Best regards, Srecko.

        • 1. Re: How to connect java 1.6 JMS client to WildFly 8.1 final?
          jbertram

          Can you not use Java 7 on your client?  Java 7 was released over 3 years ago now and Java 6 reached its end-of-life over a year ago (February 2013).

          • 2. Re: How to connect java 1.6 JMS client to WildFly 8.1 final?
            sreckom

            Client is weblogic 10.3.5, running application developed by external company. We are considering using weblogic 12 with messaging bridge. Actually big companies like Alcatel and Ericsson (I am familiar with their products) have their solutions running on older application servers and have just roadmaps for the future where they are considering moving to newer servers (and by that to newer java versions).

            • 3. Re: How to connect java 1.6 JMS client to WildFly 8.1 final?
              ctomc

              Maybe you could try compiling hornetq client with java 1.6.

              in wildfly we made sure that wildfly-controller-client, the library that is used to remotely connect to wildfly is still complied.

               

              I am not sure if hornetq can be compiled with target 1.6 but it is worth a try.

               

              https://github.com/hornetq/hornetq/tree/master/hornetq-core-client

              • 4. Re: How to connect java 1.6 JMS client to WildFly 8.1 final?
                jmesnil

                what is the stack trace when QueueConnectionFactory.createQueueConnection fails?

                • 5. Re: How to connect java 1.6 JMS client to WildFly 8.1 final?
                  sreckom

                  This is the entire stacktrace:

                  javax.jms.JMSException: Failed to create session factory

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

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

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

                      at si.telekom.general.mdb.routing.main.JMSSenderUtility$JMSSenderWithTimeout.call(JMSSenderUtility.java:117)

                      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

                      at java.util.concurrent.FutureTask.run(FutureTask.java:138)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                      at java.lang.Thread.run(Thread.java:662)

                  Caused by: java.lang.IllegalStateException: The following keys are invalid for configuring a connector: http-upgrade-endpoint, http-upgrade-enabled

                      at org.hornetq.core.client.impl.ClientSessionFactoryImpl.checkTransportKeys(ClientSessionFactoryImpl.java:1504)

                      at org.hornetq.core.client.impl.ClientSessionFactoryImpl.<init>(ClientSessionFactoryImpl.java:205)

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

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

                      ... 8 more

                  • 6. Re: How to connect java 1.6 JMS client to WildFly 8.1 final?
                    jmesnil

                    You have this failure because it is likely that the connection-factory that you have configured in the messaging subsystem is still referencing the http-connector that defines these keys (http-upgrade-endpoint, http-upgrade-enabled).

                     

                    If you have defined a remote-connector, you need to reference it from the connection-factory, it should work using an older HornetQ client.

                     

                     

                     

                    • 7. Re: How to connect java 1.6 JMS client to WildFly 8.1 final?
                      sreckom

                      Jeff, thank you. The problem was indeed with the connection factory. I had to configure a new socket binding (messaging), attach new connector and acceptor (I called it netty as it is called on jboss 7) onto hornetq server and then I configured a new connection factory. Now it works. Thank you again.