12 Replies Latest reply on Jan 20, 2016 5:13 PM by Sumanth Bandi

    ActiveMQ integration with Wildfly

    Sumanth Bandi Newbie

      Hi,

       

      I am trying to integrate ActiveMQ 5.12 and Wildfly 9.

       

      Configured ActiveMQ with a queue named "TestQueue" and url to localhost:61616 and able to start ActiveMQ

       

      Then copied rar file to standalone/deployments folder

       

      Then updated resource-adapter subsystem in standalone-full-ha.xml and also mdb resource-adapter under ejb3 subsystem.

       

      But ear deployment is failing with the following errors:

       

      "jboss.naming.context.java.comp.TestPilot.TestPilot-ejb.TestMDB.DefaultJMSConnectionFactory is missing [jboss.naming.context.java.comp.TestPilot.TestPilot-ejb.TestMDB.env.ActiveMQ.QueueConnectionFactory]",

       

      service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.CREATE (missing) dependents: [service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.START]
        service jboss
      .deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.JndiBindingsService (missing) dependents: [service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".jndiDependencyService]
        service jboss
      .deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.START (missing) dependents: [service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".moduleDeploymentRuntimeInformationStart, service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".deploymentCompleteService]
        service jboss
      .deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.VIEW."com.xxx.TestPilot.ejb.TestDB".REMOTE (missing) dependents: [service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.START]
        service jboss
      .deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.WeldInstantiator (missing) dependents: [service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.START]
        service jboss
      .deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.WeldInterceptorBindingsService (missing) dependents: [service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.WeldInstantiator]
        service jboss
      .deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.ejb.non-functional-timerservice (missing) dependents: [service jboss.deployment.subunit."TestPilot.ear"."TestPilot-ejb.jar".component.TestEJB.START]


      Any help will be appreciated.

        • 1. Re: ActiveMQ integration with Wildfly
          Wolfgang Mayer Master

          Did you also configure the connection factory as described in How to Use Out of Process ActiveMQ with WildFly?

          • 2. Re: ActiveMQ integration with Wildfly
            Sumanth Bandi Newbie

            Yes i configured the connection factory as followed in standalone-full-ha.xml under resource-adapter subsystem

             

            <connection-definitions>

                      <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="ActiveMQ/QueueConnectionFactory" enabled="true" use-java-context="true" pool-name="QueueConnectionFactory" use-ccm="true">

                                        <xa-pool>

                                            <min-pool-size>1</min-pool-size>

                                            <max-pool-size>200</max-pool-size>

                                        </xa-pool>

                                        <timeout>

                                            <blocking-timeout-millis>30000</blocking-timeout-millis>

                                            <idle-timeout-minutes>5</idle-timeout-minutes>

                                        </timeout>

                      </connection-definition>

            </connection-definitions>

             

            and mentioned the same connectionFactory in default-bindings of ee subsystem.

             

            <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" jms-connection-factory="ActiveMQ/QueueConnectionFactory" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>

            • 3. Re: ActiveMQ integration with Wildfly
              Sumanth Bandi Newbie

              I also see this in the logs stating "ActiveMQ/QueueConnectionFactory" started

               

              DEBUG [org.jboss.as.connector] (MSC service thread 1-5) started AdminObjectService service jboss.connector.admin-object."java:/queue/TestQueue"

              DEBUG [org.jboss.as.connector] (MSC service thread 1-8) started ConnectionFactoryService service jboss.connector.connection-factory.reference-factory.java:/ActiveMQ/QueueConnectionFactory

              • 4. Re: ActiveMQ integration with Wildfly
                jaikiran pai Master

                Can you post the relevant code and configurations of your EJB (TestEJB)?

                • 5. Re: ActiveMQ integration with Wildfly
                  Wolfgang Mayer Master

                  Did you also configure the DefaultJMSConnectionFactory?

                  Do you also get a messages like:

                   

                  WFLYMSG0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory

                  ..

                  WFLYJCA0002: Bound JCA ConnectionFactory [java:/ActiveMQ/QueueConnectionFactory]

                   

                  Is threre a reason why you did not add the 'java:' prefix to you jndi name?

                  • 6. Re: ActiveMQ integration with Wildfly
                    Sumanth Bandi Newbie

                    Earlier i removed messaging subsystem and set the default-bindings as below

                    <default-bindings context-service="java:jboss/ee/concurrency/context/default" jms-connection-factory="ActiveMQ/QueueConnectionFactory"/>

                     

                    Now, i kept default messaging subsystem which has DefaultJMSConnectionFactory. Now i changed default-bindings to

                    <default-bindings context-service="java:jboss/ee/concurrency/context/default" jms-connection-factory="java:jboss/DefaultJMSConnectionFactory"/>

                    Now, i am seeing both messages in the logs as below

                    WFLYMSG0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory

                    WFLYJCA0002: Bound JCA ConnectionFactory [java:/ActiveMQ/QueueConnectionFactory]

                    • 7. Re: ActiveMQ integration with Wildfly
                      Wolfgang Mayer Master

                      And do you now still get the error messages mentioned above?

                      • 8. Re: ActiveMQ integration with Wildfly
                        Sumanth Bandi Newbie

                        I am not getting the errors but i am not convinced because if i keep messaging subsystem with hornetq configuration, then i am not getting errors that means EJB/MDB are making use of internal hornetq DefaultConnectionFactory. But i am trying to integrate "ActiveMQ/QueueConnectionFactory"

                        • 10. Re: ActiveMQ integration with Wildfly
                          Sumanth Bandi Newbie

                          Now it is working for me. Issue was with JNDI name  "ActiveMQ/QueueConnectionFactory"

                           

                          It should be prefixed with java:/    -       "java:/ActiveMQ/QueueConnectionFactory"


                          1 of 1 people found this helpful
                          • 11. Re: ActiveMQ integration with Wildfly
                            Matt G Madhavan Newbie

                            Hello,

                            I have been struggling with is issue for over a month now!

                             

                            I am getting the following at the log!
                            13:15:02,201 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-1) WFLYJCA0007: Registered connection factory java:/activemq/xaConnectionFactory
                            13:15:02,205 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-1) WFLYJCA0006: Registered admin object at java:/queue/HELLOWORLDMDBQueue
                            13:15:02,208 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-1) WFLYJCA0006: Registered admin object at java:/topic/HELLOWORLDMDBTopic
                            13:15:02,217 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-2) WFLYJCA0002: Bound JCA AdminObject [java:/topic/HELLOWORLDMDBTopic]
                            13:15:02,217 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-5) WFLYJCA0002: Bound JCA AdminObject [java:/queue/HELLOWORLDMDBQueue]
                            13:15:02,217 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-7) WFLYJCA0002: Bound JCA ConnectionFactory [java:/activemq/xaConnectionFactory]
                            
                            

                             

                            This tells me the ActiveMQ is configured and running OK (external activeMQ).

                             

                            But when I get a connection Im getting the following exceptions - Seems like some kinda classloading issues! Any ideas please?

                            java.lang.ClassCastException:

                            org.apache.activemq.transport.tcp.TcpTransportFactory cannot be cast to

                            org.apache.activemq.transport.TransportFactory

                             

                             

                            Caused by: java.io.IOException: Transport scheme NOT recognized: [tcp]
                                at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
                                at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:189)
                                at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:68)
                                at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:333)
                                ... 67 more
                            Caused by: java.lang.ClassCastException: org.apache.activemq.transport.tcp.TcpTransportFactory cannot be cast to org.apache.activemq.transport.TransportFactory
                                at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:186)
                                ... 69 more
                            
                            • 12. Re: ActiveMQ integration with Wildfly
                              Sumanth Bandi Newbie

                              Can you post your code for setting up the connectionFactory?