9 Replies Latest reply on Apr 22, 2014 10:32 AM by jbertram

    ActiveMQ integration - DuplicateServiceException

    steven.post

      Hi,

       

      (I first posted this on the user mailing list, but no-one seems to use that, everything appears to be happening here in the forum)

       

      I'm trying to run a MessageDrivenBean on JBoss, connecting to an

      ActiveMQ broker outside of JBoss.

      However when starting JBoss I get the following error as the cause of a

      larger stacktrace:

       

      org.jboss.msc.service.DuplicateServiceException: Service

      jboss.connector.connection-factory.java:jboss/activemq/ConnectionFactory

      is already registered

       

      It appears I'm hitting this bug:

      https://issues.jboss.org/browse/JBJCA-641

      Unfortunately the workaround doesn't seem to work, or I'm missing

      something. Also, the bug is marked closed as of agust 5th 2011 and no

      comments were ever added to it.

       

      Has anyone successfully connected JBoss 7 to an ActiveMQ broker already?

      I've seen several forum posts about it, but none of them were ever

      solved.

       

      I'm running JBoss 7.1.0.CR1b and trying to use a resource adapter from

      ActiveMQ 5.5.1. The configuration is pretty default, no changes were

      made to the ra.xml inside the activemq-rar-5.5.1.rar file (dropped in

      standalone/deployments), the standalone.xml was modified to use ActiveMQ

      for mdb's instead of hornetQ and to include a resource-adapter subsystem

      definition with connection-definitions like this (full configuration attached):

       

      <connection-definition

      class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"

      jndi-name="java:jboss/activemq/TopicConnectionFactory"

       

      currently 3 exist.

       

      Any suggestions?

       

      Kind regards,

      Steven

        • 1. Re: ActiveMQ integration - DuplicateServiceException
          jaikiran

          Welcome to the forums!

           

           

          Steven Post wrote:

           

          Hi,

           

          (I first posted this on the user mailing list, but no-one seems to use that, everything appears to be happening here in the forum)

           

          Which one is that?

           

           

          Steven Post wrote:

          However when starting JBoss I get the following error as the cause of a

          larger stacktrace:

           

          org.jboss.msc.service.DuplicateServiceException: Service

          jboss.connector.connection-factory.java:jboss/activemq/ConnectionFactory

          is already registered

           

          Can you please post the entire exception stacktrace?

          • 2. Re: ActiveMQ integration - DuplicateServiceException
            steven.post

            Thanks for the welcome, and looking into it.

             

            The list is jboss-user at jboss dot com.

             

            The full startup log is attached (only 1 startup, I trimmed the others), it is not too big so I just included it all. There is a second stack trace on there, about a class not found, but that one differs every startup and I figure it is the result of the first one, the DuplicateServiceException. The class files for that second one are properly included in several jar files within the activemq-rar-5.5.1.rar file.

            • 3. Re: ActiveMQ integration - DuplicateServiceException
              steven.post

              Does anyone have any thoughts? I'd really like to integrate JBoss 7 with ActiveMQ

              • 4. Re: ActiveMQ integration - DuplicateServiceException
                jaikiran

                The important part of the logs is:

                21:22:39,058 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:jboss/activemq/TopicConnectionFactory
                21:22:39,073 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:jboss/activemq/ConnectionFactory
                21:22:39,074 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:jboss/activemq/QueueConnectionFactory
                21:22:39,074 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:jboss/activemq/TopicConnectionFactory
                21:22:39,081 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.ra.deployment."activemq-rar-5.5.1_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."activemq-rar-5.5.1_1": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [activemq-rar-5.5.1]
                    at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:123)
                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_147-icedtea]
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_147-icedtea]
                    at java.lang.Thread.run(Thread.java:722) [:1.7.0_147-icedtea]
                Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [activemq-rar-5.5.1]
                    at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:108)
                    ... 5 more
                Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/usr/local/jboss-7.1.0/standalone/tmp/vfs/temp99d2db4abf4b2eab/activemq-rar-5.5.1.rar-795a97fb4e96e2a2/contents/
                    at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:2174)
                    at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:170)
                    at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:103)
                    ... 5 more
                Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.connector.connection-factory.java:jboss/activemq/TopicConnectionFactory is already registered
                    at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:226) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2211) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                    at org.jboss.as.connector.metadata.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.bindConnectionFactory(AbstractResourceAdapterDeploymentService.java:262)
                    at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1946)
                    ... 7 more
                
                

                 

                So it's trying to register the TopicConnectionFactory twice which looks like configuration issue. What does your standalone*.xml look like?

                 

                By the way, there's another thread in this forum where users have been able to integrate ActiveMQ in AS7 (except for a bug in ActiveMQ).

                • 5. Re: ActiveMQ integration - DuplicateServiceException
                  steven.post

                  The full standalone.xml is attached in the first post.

                  • 6. Re: ActiveMQ integration - DuplicateServiceException
                    raghav.prakasam

                    Hi ,

                     

                    Please anyone  let me know the work around for this bug in jboss or if there any patches available for jboss.Thanks in advance

                    • 7. Re: ActiveMQ integration - DuplicateServiceException
                      jbertram

                      Are you still trying with JBoss AS 7.x or are you trying with WildFly 8.0.0.Final (or 8.1.0.CR1)?

                      • 8. Re: ActiveMQ integration - DuplicateServiceException
                        raghav.prakasam

                        Hi,

                         

                        Yes am using JBoss 7.1.1 version as a part of Liferay 6.2 bundle.ActiveMQ got installed fine in Wildfly 8.0.0 but unfortunately i cant use this since am using Liferay bundle.

                        Please provide me any workarounds over 7.1.1 version.

                        • 9. Re: ActiveMQ integration - DuplicateServiceException
                          jbertram

                          You might try taking a newer tag of JBoss AS 7.x and building it yourself.  Otherwise I think you'd need to move to WildFly 8.x.