12 Replies Latest reply on Oct 1, 2011 12:42 PM by Jean-Pierre RIO

    DuplicateServiceException on JMS

    Baljit Singh Newbie

      Hi ,

       

      Why are the queues getting registered twice?

       

      15:39:51,053 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer] (MSC service thread 1-4) IJ020001: Required license terms for file:/C:/Temp/jboss-as-7.0.0.Final/standalone/deployments/activemq-rar.rar/

      15:39:51,069 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-4) IJ020001: Required license terms for file:/C:/Temp/jboss-as-7.0.0.Final/standalone/deployments/activemq-rar.rar/

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG ActiveMQResourceAdapter        - setting [serverUrl] to: vm://localhost

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG ActiveMQResourceAdapter        - setting [userName] to: defaultUser

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG ActiveMQResourceAdapter        - setting [password] property

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG ActiveMQResourceAdapter        - setting [useInboundSession] to: false

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - copying standard ResourceAdapter configuration properties

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [clientid] to: null

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [password] property

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [serverUrl] to: vm://localhost

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [useInboundSession] to: false

      15:39:51,100 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,100 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [userName] to: defaultUser

      15:39:51,115 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-4) Registered connection factory java:/jms/mopsQueueConnectionFactory2 on mdr

      15:39:51,115 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,115 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - copying standard ResourceAdapter configuration properties

      15:39:51,115 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,115 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [clientid] to: null

      15:39:51,115 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,115 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [password] property

      15:39:51,115 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,115 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [serverUrl] to: vm://localhost

      15:39:51,115 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,115 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [useInboundSession] to: false

      15:39:51,115 INFO  [stdout] (MSC service thread 1-4) 2011-07-22 15:39:51,115 [vice thread 1-4] DEBUG tiveMQManagedConnectionFactory - setting [userName] to: defaultUser

      15:39:51,115 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-4) Registered connection factory java:/jms/mopsQueueConnectionFactory2 on mdr

      15:39:51,115 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.raxml.activemq-rar: org.jboss.msc.service.StartException in service jboss.raxml.activemq-rar: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [activemq-rar]

       

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

       

       

      More Error Message :

       

       

      I am using <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"> to configure activemq queues. During server startup, I am getting

      Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.connector.connection-factory.java:/jms/mopsQueueConnectionFactory2 is already registered

       

       

      11:41:12,431 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.raxml.activemq-rar: org.jboss.msc.service.StartException in service jboss.raxml.activemq-rar: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [activemq-rar]

              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:106)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]

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

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

      Caused by: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [activemq-rar]

              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:98)

              ... 5 more

      Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/C:/Temp/jboss-as-7.0.0.Final/standalone/deployments/activemq-rar.rar/

              at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1778)

              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:140)

              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:96)

              ... 5 more

      Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.connector.connection-factory.java:/jms/mopsQueueConnectionFactory2 is already registered

              at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154)

              at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:226)

              at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560)

              at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)

              at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2194)

              at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307)

              at org.jboss.as.connector.metadata.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.bindConnectionFactory(AbstractResourceAdapterDeploymentService.java:229)

              at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1563)

              ... 7 more

       

      11:41:12,478 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "activemq-rar.rar" was rolled back with failure message {"Failed services" => {"jboss.raxml.activemq-rar" => "org.jboss.msc.service.StartException in service jboss.raxml.activemq-rar: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [activemq-rar]"}}

       

      Thanks

       

      Baljit

        • 2. Re: DuplicateServiceException on JMS
          Baljit Singh Newbie

          Jaikiran,

           

          I have attached the requested configuration file to the orginal message.

           

          Thanks for looking into it.

           

          Baljit

          • 3. Re: DuplicateServiceException on JMS
            Baljit Singh Newbie

            Jaikaran,

             

            Any update on this issue?

             

            Thanks

             

            Baljit

            • 4. Re: DuplicateServiceException on JMS
              jaikiran pai Master

              I haven't been able to look at this yet. If someone else get to this before me, then I'll take a look at this later tomorrow.

              • 5. Re: DuplicateServiceException on JMS
                Baljit Singh Newbie

                Thanks for the reply. Do you think it is a bug or the way I have define the queues are incorrect?

                • 6. Re: DuplicateServiceException on JMS
                  Mark de Jong Newbie

                  I have the same issue. Any update on this issue?

                   

                  Thanks

                   

                  Mark

                  • 7. Re: DuplicateServiceException on JMS
                    jaikiran pai Master

                    Can you try this against the latest AS7 nightly build?

                    1 of 1 people found this helpful
                    • 8. Re: DuplicateServiceException on JMS
                      Mark de Jong Newbie

                      Still getting the same exception with the latest nightly build:

                       

                      {code}

                      12:05:40,464 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "activemq-paymentportal-ra.rar"

                      12:05:41,205 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api dependency to activemq-paymentportal-ra.rar

                      12:05:41,290 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer] (MSC service thread 1-2) IJ020001: Required license terms for file:/C:/Java/jboss/jboss-as-7.0

                      .0.Final/standalone/tmp/vfs/tempfb218dd4b2f87a85/activemq-paymentportal-ra.rar-1b15403b9136a5fb/contents/

                      12:05:41,297 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-1) IJ020001: Required license terms for file:/C:/Java/jboss/jboss-

                      as-7.0.0.Final/standalone/tmp/vfs/tempfb218dd4b2f87a85/activemq-paymentportal-ra.rar-1b15403b9136a5fb/contents/

                      12:05:41,330 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-1) Registered connection factory java:/jboss/gatso/ConnectionFacto

                      ry on mdr

                      12:05:41,332 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-1) Registered connection factory java:/jboss/gatso/ConnectionFacto

                      ry on mdr

                      12:05:41,333 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.raxml.activemq-paymentportal-ra: org.jboss.msc.service.StartException in service jboss.raxml

                      .activemq-paymentportal-ra: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [activemq-paymentportal-ra]

                              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:106)

                              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

                              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]

                              at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]

                      Caused by: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [activemq-paymentportal-ra]

                              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:98)

                              ... 5 more

                      Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/C:/Java/jboss/jboss-as-7.0.0.Final/standalone/tmp/vfs/tempfb218dd4b2f87a85/activemq-paymentportal-ra.rar-1b1540

                      3b9136a5fb/contents/

                              at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1778)

                              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:140)

                              at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:96)

                              ... 5 more

                      Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.connector.connection-factory.java:/jboss/gatso/ConnectionFactory is already registered

                              at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154)

                              at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:226)

                              at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560)

                              at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)

                              at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2194)

                              at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307)

                              at org.jboss.as.connector.metadata.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.bindConnectionFactory(AbstractResourceAdapterDeploymentService.java:229)

                              at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1563)

                              ... 7 more

                       

                       

                      12:05:41,462 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployment of "activemq-paymentportal-ra.rar" was rolled back with failure message {"Failed services" => {"jboss.raxml.ac

                      tivemq-paymentportal-ra" => "org.jboss.msc.service.StartException in service jboss.raxml.activemq-paymentportal-ra: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment

                      [activemq-paymentportal-ra]"}}

                      12:05:41,498 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment activemq-paymentportal-ra.rar in 34ms

                      12:05:41,554 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.ra

                      xml.activemq-paymentportal-ra" => "org.jboss.msc.service.StartException in service jboss.raxml.activemq-paymentportal-ra: org.jboss.msc.service.StartException in anonymous service: Failed to start RA deplo

                      yment [activemq-paymentportal-ra]"}}}}

                       

                      {/code}

                      • 10. Re: DuplicateServiceException on JMS
                        Baljit Singh Newbie

                        Looks like this problem is solved in the lastest jboss-as-7.1.0.Alpha1-SNAPSHOT.

                         

                        Thanks

                         

                        Baljit

                        • 11. Re: DuplicateServiceException on JMS
                          Mark de Jong Newbie

                          @Jesper Sorry for the late reply, was on holidays The resource adapter is now deployed w/o errors however i can't reference it from my .ear (@ResourceAdapter). It also doesn't show up the administration console.

                           

                          The exception is thrown by activemq that the RA is already set...

                           

                          13:49:55,460 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."GatsoPaymentPortal.ear"."GatsoPaymentPortal.jar".component.CitationMessa

                          geSubscriber.CREATE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."GatsoPaymentPortal.ear"."GatsoPaymentPortal.jar".component.CitationMessageSubscriber.CREATE: Failed to start s

                          ervice

                                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1786)

                                  at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

                                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_27]

                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_27]

                                  at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]

                          Caused by: java.lang.RuntimeException: javax.resource.ResourceException: ResourceAdapter already set

                                  at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentCreateService.createComponent(MessageDrivenComponentCreateService.java:85)

                                  at org.jboss.as.ee.component.BasicComponentCreateService.start(BasicComponentCreateService.java:78)

                                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

                                  ... 4 more

                          Caused by: javax.resource.ResourceException: ResourceAdapter already set

                                  at org.apache.activemq.ra.ActiveMQActivationSpec.setResourceAdapter(ActiveMQActivationSpec.java:234)

                                  at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentCreateService.createComponent(MessageDrivenComponentCreateService.java:83)

                                  ... 6 more

                          • 12. Re: DuplicateServiceException on JMS
                            Jean-Pierre RIO Newbie

                            Hi,

                            I have the same problem ("RA is already set") with a recent build (7.1.0-Alpha2 from september, 29th). Looking at the code, we have :

                             

                            org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentCreateService :

                             

                                   try {

                                        activationSpec.setResourceAdapter(resourceAdapter);

                                    } catch (ResourceException e) {

                                        throw new RuntimeException(e);

                                    }

                             

                            and org.apache.activemq.ra.ActiveMQActivationSpec :

                             

                                public void setResourceAdapter(ResourceAdapter resourceAdapter) throws ResourceException {

                                    // spec section 5.3.3

                                    if (this.resourceAdapter != null) {

                                        throw new ResourceException("ResourceAdapter already set");

                                    }

                             

                             

                            Note : if i don't specify a <resource-adapters> in my standalone-preview.xml, i have a "Service service "activemq-rar-5.5.0" not found" (see http://community.jboss.org/message/624774#624774).

                             

                            Thank you for your help, AMQ integration is a "must-have" for our jbas7 migration !