1 2 3 Previous Next 31 Replies Latest reply on Mar 27, 2012 4:43 PM by john-liptak

    JBoss AS7 and activemq connector

    jprio

      Hi,

      I'm trying to receive messages from activemq with MDB in AS7 (7.1.0.Alpha1-SNAPSHOT, standalone-preview.xml configuration). What i do :

      - copy the activemq-rar-5.5.0.rar in standalone/deployments

      - add the resource adapter description :

                      <resource-adapter>

                          <archive>

                              activemq-rar-5.5.0.rar

                          </archive>

                          <transaction-support>

                              NoTransaction

                          </transaction-support>

                          <connection-definitions>

                              <connection-definition class-name="org.apache.activemq.ra.ActiveMQConnectionFactory" jndi-name="java:/eis/amq" enabled="true" use-java-context="true" pool-name="activemq-rar-5_5_0_jar-Pool" use-ccm="true"/>

                          </connection-definitions>

                      </resource-adapter>

      - annotate my MDB with : @org.jboss.ejb3.annotation.ResourceAdapter(value="activemq-rar-5.5.0.rar")

       

       

      When i start jboss, i can see this :

       

      07:29:46,550 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "activemq-rar-5.5.0.rar"

      07:29:47,902 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added javax.persistence.api dependency to activemq-rar-5.5.0.rar

      07:29:48,017 TRACE [org.jboss.as.connector.deployer.raxmldeployer] (MSC service thread 1-2) processing Raxml

      07:29:48,021 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer] (MSC service thread 1-5) IJ020001: Required license terms for file:/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha1-SNAPSHOT/bin/../standalone/tmp/vfs/temp5de4028d1045bd2/activemq-rar-5.5.0.rar-5a3643b13e66d7b9/contents/

      07:29:48,034 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer] (MSC service thread 1-5) Registering ResourceAdapter activemq-rar-5.5.0

      07:29:48,034 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer] (MSC service thread 1-5) Activated: file:/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha1-SNAPSHOT/bin/../standalone/tmp/vfs/temp5de4028d1045bd2/activemq-rar-5.5.0.rar-5a3643b13e66d7b9/contents/

      07:29:48,036 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) IJ020001: Required license terms for file:/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha1-SNAPSHOT/bin/../standalone/tmp/vfs/temp5de4028d1045bd2/activemq-rar-5.5.0.rar-5a3643b13e66d7b9/contents/

      07:29:48,074 ERROR [stderr] (MSC service thread 1-5) log4j:WARN No appenders could be found for logger (org.apache.activemq.ra.ActiveMQResourceAdapter).

      07:29:48,074 ERROR [stderr] (MSC service thread 1-5) log4j:WARN Please initialize the log4j system properly.

      07:29:48,075 TRACE [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) ResourceAdapter: org.apache.activemq.ra.ActiveMQResourceAdapter

      07:29:48,075 TRACE [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) ResourceAdapter defined in classloader: ModuleClassLoader for Module "deployment.activemq-rar-5.5.0.rar:main" from Service Module Loader

      07:29:48,075 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) No activation: org.apache.activemq.ra.ActiveMQManagedConnectionFactory

      07:29:48,075 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) No activation: org.apache.activemq.ra.ActiveMQManagedConnectionFactory

      07:29:48,075 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) No activation: org.apache.activemq.ra.ActiveMQManagedConnectionFactory

      07:29:48,075 TRACE [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) ActivationSpec: org.apache.activemq.ra.ActiveMQActivationSpec

      07:29:48,075 TRACE [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) ActivationSpec defined in classloader: ModuleClassLoader for Module "deployment.activemq-rar-5.5.0.rar:main" from Service Module Loader

      07:29:48,076 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) No activation: org.apache.activemq.command.ActiveMQQueue

      07:29:48,076 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) No activation: org.apache.activemq.command.ActiveMQTopic

      07:29:48,076 DEBUG [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) Registering ResourceAdapter activemq-rar-5.5.0

      07:29:48,076 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-5) IJ020002: Deployed: file:/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha1-SNAPSHOT/bin/../standalone/tmp/vfs/temp5de4028d1045bd2/activemq-rar-5.5.0.rar-5a3643b13e66d7b9/contents/

      07:29:48,077 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-5) Starting sevice service jboss.ra."activemq-rar-5.5.0_1"

      07:29:48,077 DEBUG [org.jboss.as.connector] (MSC service thread 1-7) started ResourceAdapterService service jboss.ra."activemq-rar-5.5.0_1"

      07:29:48,089 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployed "activemq-rar-5.5.0.rar"

      ...

      ...

      07:30:43,313 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."JBossAS7_dev_labs-0.0.1-SNAPSHOT.jar".component.MDB-amq.CREATE: org.jboss.msc.service.StartException in service jboss.deployment.unit."JBossAS7_dev_labs-0.0.1-SNAPSHOT.jar".component.MDB-amq.CREATE: Failed to start service

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                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.ServiceNotFoundException: Service service "activemq-rar-5.5.0" not found

                at org.jboss.msc.service.ServiceContainerImpl.getRequiredService(ServiceContainerImpl.java:447) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentCreateService.getRequiredService(MessageDrivenComponentCreateService.java:119)

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

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

                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]

                ... 3 more

       

      Can someone tell me what's wrong ?

        • 1. Re: JBoss AS7 and activemq connector
          jaikiran

          There are a few bugs we have identified in this area and are working on a fix:

           

          https://issues.jboss.org/browse/AS7-1580

          https://issues.jboss.org/browse/AS7-1691

          • 2. Re: JBoss AS7 and activemq connector
            jaikiran

            We believe we have fixed these issues in the latest AS7 nightly build. Can you please try this against the nightly build and let us know if you run into these errors?

            • 3. Re: JBoss AS7 and activemq connector
              jprio

              Hi Jaikiran,

              It seem's that the problem is still there .

              If i don't specify a <resource-adapter>, i have a "Service service "activemq-rar-5.5.0" not found" and if i specify a <resource-adapter>, i have a :

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

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

               

               

              If it may help, here is the result of the invocation of the mbean jboss.msc:type=container,name=jboss-as:queryServiceNames (only the lines where my adapter appears) when i don't specify a <resource-adapter> :

               

              jboss.deployment.unit."activemq-rar-5.5.0.rar"

              jboss.deployment.unit."activemq-rar-5.5.0.rar".CLEANUP

              jboss.deployment.unit."activemq-rar-5.5.0.rar".CONFIGURE_MODULE

              jboss.deployment.unit."activemq-rar-5.5.0.rar".DEPENDENCIES

              jboss.deployment.unit."activemq-rar-5.5.0.rar".INSTALL

              jboss.deployment.unit."activemq-rar-5.5.0.rar".PARSE

              jboss.deployment.unit."activemq-rar-5.5.0.rar".POST_MODULE

              jboss.deployment.unit."activemq-rar-5.5.0.rar".STRUCTURE

              jboss.deployment.unit."activemq-rar-5.5.0.rar".contents

              jboss.deployment.unit."activemq-rar-5.5.0.rar".jndiDependencyService

              jboss.deployment.unit."activemq-rar-5.5.0.rar".moduleDeploymentRuntimeInformation

              jboss.module.information.service."deployment.activemq-rar-5.5.0.rar".main

              jboss.module.service."deployment.activemq-rar-5.5.0.rar".main

              jboss.module.spec.service."deployment.activemq-rar-5.5.0.rar".main

              jboss.naming.context.java.app."activemq-rar-5.5.0"

              jboss.naming.context.java.app."activemq-rar-5.5.0".AppName

              jboss.naming.context.java.module."activemq-rar-5.5.0"."activemq-rar-5.5.0"

              jboss.naming.context.java.module."activemq-rar-5.5.0"."activemq-rar-5.5.0".ModuleName

              jboss.ra.deployer."activemq-rar-5.5.0"

               

              ... and when i specify one, two more lines appear :

               

              jboss.ra."activemq-rar-5.5.0_1"

              jboss.ra.deployment."activemq-rar-5.5.0_1"

               

               

              Regards,

              Jean-Pierre

              • 4. Re: JBoss AS7 and activemq connector
                jesper.pedersen

                You need the MCF class name in the "class-name" attribute.

                 

                Make sure that you are using the latest AS 7.1 built - it has to say IronJacamar 1.0.4 during startup - and then post the entire stack trace if there still is a problem.

                 

                IronJacamar 1.0.5 will contain better feedback for invalid <connection-definition> configurations.

                • 5. Re: JBoss AS7 and activemq connector
                  jprio

                  Hi,

                  Yes, I'm using ijm 1.0.4.Final.

                  My config :

                         <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

                              <resource-adapters>

                                  <resource-adapter>

                                      <archive>

                                          activemq-rar-5.5.0.rar

                                      </archive>

                                      <transaction-support>

                                          LocalTransaction

                                      </transaction-support>

                                      <config-property name="ServerUrl">

                                          tcp://localhost:61616

                                      </config-property>

                                      <connection-definitions>

                                          <connection-definition class-name="javax.jms.QueueConnectionFactory" jndi-name="java:/activemq/QueueConnectionFactory" pool-name="ActiveMQQueueConnectionPool">

                                              <config-property name="ServerUrl">

                                                  vm://localhost

                                              </config-property>

                                              <pool>

                                                  <min-pool-size>

                                                      1

                                                  </min-pool-size>

                                                  <max-pool-size>

                                                      200

                                                  </max-pool-size>

                                                  <prefill>

                                                      true

                                                  </prefill>

                                                  <use-strict-min>

                                                      true

                                                  </use-strict-min>

                                              </pool>

                                          </connection-definition>

                                      </connection-definitions>

                                  </resource-adapter>

                              </resource-adapters>

                          </subsystem>

                   

                   

                  ...and the entire stack trace :

                  =========================================================================

                   

                   

                    JBoss Bootstrap Environment

                   

                   

                    JBOSS_HOME: ..

                   

                   

                    JAVA: /usr/lib/jvm/jdk1.6.0_24/bin/java

                   

                   

                    JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

                   

                   

                  =========================================================================

                   

                   

                  18:45:33,499 INFO  [org.jboss.modules] JBoss Modules version 1.0.2.GA

                  18:45:33,812 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA

                  18:45:33,859 INFO  [org.jboss.as] JBoss AS 7.1.0.Alpha2-SNAPSHOT "Ahoy!" starting

                  18:45:34,998 WARN  [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.

                  18:45:35,006 INFO  [org.jboss.as] creating http management service using network interface (management) port (9990)

                  18:45:35,064 WARN  [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.

                  18:45:35,080 INFO  [org.jboss.as.logging] JBAS011501: Removing bootstrap log handlers

                  18:45:35,103 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)

                  18:45:35,140 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.

                  18:45:35,181 INFO  [org.jboss.as.jacorb] (Controller Boot Thread) Activating JacORB Subsystem

                  18:45:35,243 INFO  [org.jboss.as.naming] (Controller Boot Thread) JBAS011800: Activating Naming Subsystem

                  18:45:35,246 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service

                  18:45:35,246 INFO  [org.jboss.as.mail.extension.MailSessionAdd] (MSC service thread 1-5) Bound mail session [java:jboss/mail/Default]

                  18:45:35,250 INFO  [org.jboss.as.osgi] (Controller Boot Thread) JBAS011910: Activating OSGi Subsystem

                  18:45:35,262 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem

                  18:45:35,262 INFO  [org.jboss.remoting] (MSC service thread 1-7) JBoss Remoting version 3.2.0.Beta2

                  18:45:35,285 INFO  [org.xnio] (MSC service thread 1-7) XNIO Version 3.0.0.Beta3

                  18:45:35,310 INFO  [org.xnio.nio] (MSC service thread 1-7) XNIO NIO Implementation Version 3.0.0.Beta3

                  18:45:35,457 INFO  [org.jboss.as.webservices] (Controller Boot Thread) Activating WebServices Extension

                  18:45:35,463 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-6) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/jdk1.6.0_24/jre/lib/i386/server:/usr/lib/jvm/jdk1.6.0_24/jre/lib/i386:/usr/lib/jvm/jdk1.6.0_24/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib

                  18:45:35,519 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) Listening on /127.0.0.1:9999

                  18:45:35,533 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem

                  18:45:35,535 INFO  [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-6) Starting remote JMX connector

                  18:45:35,598 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Démarrage de Coyote HTTP/1.1 sur http-localhost.localdomain-127.0.0.1-8080

                  18:45:35,817 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-1) JBoss Web Services - Stack CXF Server 4.0.0.Beta4

                  18:45:35,872 INFO  [org.jboss.as.connector] (MSC service thread 1-8) JBAS010408: Starting JCS Subsystem (JBoss IronJacamar 1.0.4.Final)

                  18:45:35,914 INFO  [org.jboss.as.jacorb] (MSC service thread 1-5) CORBA ORB Service Started

                  18:45:35,919 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

                  18:45:36,046 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/data/messagingjournal,bindingsDirectory=/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/data/messagingbindings,largeMessagesDirectory=/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/data/messaginglargemessages,pagingDirectory=/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/data/messagingpaging)

                  18:45:36,068 INFO  [org.jboss.as.jacorb] (MSC service thread 1-8) CORBA Naming Service Started

                  18:45:36,101 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:/JmsXA

                  18:45:36,096 ATTENTION [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.

                  18:45:36,106 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-6) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]

                  18:45:36,135 INFO  [org.hornetq.ra.HornetQResourceAdapter] (MSC service thread 1-3) HornetQ resource adaptor started

                  18:45:36,136 INFO  [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-3) IJ020002: Deployed: file://RaActivatorhornetq-ra

                  18:45:36,322 INFO  [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-4) Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost.localdomain:5455 for CORE protocol

                  18:45:36,337 INFO  [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-4) Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost.localdomain:5445 for CORE protocol

                  18:45:36,348 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) Server is now live

                  18:45:36,349 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) HornetQ Server version 2.2.7.Final (HQ_2_2_7_FINAL_AS7, 121) [b79d7625-e85c-11e0-b81c-0007cb0000ff] started

                  18:45:36,391 INFO  [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory

                  18:45:36,392 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-8) trying to deploy queue jms.topic.testTopic

                  18:45:36,530 INFO  [org.jboss.as.messaging] (MSC service thread 1-8) JBAS011601: Bound messaging object to jndi name java:/topic/test

                  18:45:36,531 INFO  [org.jboss.as.messaging] (MSC service thread 1-1) JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory

                  18:45:36,531 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-7) trying to deploy queue jms.queue.testQueue

                  18:45:36,560 INFO  [org.jboss.as.messaging] (MSC service thread 1-7) JBAS011601: Bound messaging object to jndi name java:/queue/test

                  18:45:36,694 INFO  [org.jboss.as.deployment] (MSC service thread 1-6) Started FileSystemDeploymentService for directory /media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/deployments

                  18:45:36,718 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.1.0.Alpha2-SNAPSHOT "Ahoy!" started in 3402ms - Started 133 of 192 services (59 services are passive or on-demand)

                  18:45:36,731 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "activemq-rar-5.5.0.rar"

                  18:45:38,484 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-5) IJ020001: Required license terms for file:/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/tmp/vfs/temp49be0a07515d750b/activemq-rar-5.5.0.rar-b50e1661ccdb778e/contents/

                  18:45:38,499 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-4) IJ020001: Required license terms for file:/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/tmp/vfs/temp49be0a07515d750b/activemq-rar-5.5.0.rar-b50e1661ccdb778e/contents/

                  18:45:38,588 ERROR [stderr] (MSC service thread 1-4) log4j:WARN No appenders could be found for logger (org.apache.activemq.ra.ActiveMQResourceAdapter).

                  18:45:38,589 ERROR [stderr] (MSC service thread 1-4) log4j:WARN Please initialize the log4j system properly.

                  18:45:38,595 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-4) IJ020002: Deployed: file:/media/267088430603D720/dev_station/java_station/serveurs/jboss-as-7.1.0.Alpha2-SNAPSHOT/bin/../standalone/tmp/vfs/temp49be0a07515d750b/activemq-rar-5.5.0.rar-b50e1661ccdb778e/contents/

                  18:45:38,646 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "activemq-rar-5.5.0.rar"

                  18:46:08,806 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "AMQ_MDBs.jar"

                  18:46:08,920 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."AMQ_MDBs.jar".component.SimpleMDB.CREATE: org.jboss.msc.service.StartException in service jboss.deployment.unit."AMQ_MDBs.jar".component.SimpleMDB.CREATE: Failed to start service

                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                            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: java.lang.RuntimeException: javax.resource.ResourceException: ResourceAdapter already set

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

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

                            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]

                            ... 3 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:85)

                            ... 6 more

                   

                   

                  18:46:09,126 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "AMQ_MDBs.jar" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"AMQ_MDBs.jar\".component.SimpleMDB.CREATE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"AMQ_MDBs.jar\".component.SimpleMDB.CREATE: Failed to start service"}}

                  18:46:09,146 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) Stopped deployment AMQ_MDBs.jar in 20ms

                  18:46:09,147 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.unit.\"AMQ_MDBs.jar\".component.SimpleMDB.CREATE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"AMQ_MDBs.jar\".component.SimpleMDB.CREATE: Failed to start service"}}}}

                   

                  My MDB :

                   

                  ...

                  import org.jboss.ejb3.annotation.ResourceAdapter;

                   

                  @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }, mappedName = "queue/test")

                  @ResourceAdapter(value = "activemq-rar-5.5.0.rar")

                  public class SimpleMDB implements MessageListener {

                  ...

                   

                  Moreover, i think i shouldn't have to specify this MFC (i'm only using inbound adapter).

                   

                  JP

                  • 6. Re: JBoss AS7 and activemq connector
                    ned233

                    Jean-Pierre, did you ever get this working?  I am having a similar problem.  My app server starts just fine but my MDB does not respond to any incoming messages from ActiveMQ.

                     

                    Thanks,

                    Ed

                    • 7. Re: JBoss AS7 and activemq connector
                      jprio

                      Ed,

                      Yes, I got this working (at that time in CR1-SNAPSHOT), but with some little efforts...

                       

                      I had to modify the ra implementation from activemq, first : because of this

                       

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

                       

                             try {

                                  activationSpec.setResourceAdapter(resourceAdapter);

                              } catch (ResourceException e) {

                                  throw new RuntimeException(e);

                              }


                      I had to comment out some code in org.apache.activemq.ra.ActiveMQActivationSpec (the ra was already set by JBoss in the activationSpec) :

                       

                          public void setResourceAdapter(ResourceAdapter resourceAdapter) throws ResourceException {

                              // spec section 5.3.3

                              /*

                                if (this.resourceAdapter != null) {

                                  throw new ResourceException("ResourceAdapter already set");

                              }

                           */

                       

                      And also, in org.apache.activemq.ra.ActiveMQEndpointWorker, i had to "unsynchronize" the run method (because JBoss checks it is not synchronized) :

                       

                      ...

                      connectWork = new Work() {

                                  long currentReconnectDelay = INITIAL_RECONNECT_DELAY;

                       

                                  public void release() {

                                      //

                                  }

                                  synchronized public void run() {

                                      currentReconnectDelay = INITIAL_RECONNECT_DELAY;

                                      MessageActivationSpec activationSpec = endpointActivationKey.getActivationSpec();

                      ...

                       

                      Then, I rebuild the rar, copied it in "deployments" and declared it in the conf :

                       

                              <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

                                  <resource-adapters>

                                      <resource-adapter>

                                          <archive>

                                              activemq-rar.rar

                                          </archive>

                                          <transaction-support>

                                              LocalTransaction

                                          </transaction-support>

                                          <config-property name="ServerUrl">

                                              tcp://localhost:61616

                                          </config-property>

                                      </resource-adapter>

                                  </resource-adapters>

                              </subsystem>

                       

                      And finally, my mdb :

                       

                      import org.jboss.ejb3.annotation.ResourceAdapter;

                       

                      @MessageDriven(name="LongProcessMessageBean", activationConfig = {

                                    @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),

                                    @ActivationConfigProperty(propertyName="destination", propertyValue="test1")

                      })

                      @ResourceAdapter(value = "activemq-rar")

                      public class SimpleMDB implements MessageListener {

                       

                      public void onMessage(Message message) {

                                          System.out.println("received !!!!!!!!!!!!!!!!!!!!!!!!!!!");

                                          System.out.println(message);

                        }

                       

                       

                      So i got this working but (i don't know  who's fault it is, activemq or jboss), i had to modify the code so that it works

                      If somebody from amq or jboss read this, can you please react ?

                       

                      Thanks,

                      JP

                      • 8. Re: JBoss AS7 and activemq connector
                        ned233

                        JP, have you gotten the latest snapshot distribution of JBoss 7.1?  https://community.jboss.org/thread/167590

                         

                        You might try this.  I was able to get past my "ResourceAdapter already set" error with the latest snapshot.  Now, JBoss starts with no errors for me, but my MDB does not respond to any incoming messages.  I have posted this as a separate discussion though... https://community.jboss.org/thread/177882

                         

                        Thanks,

                        Ed

                        • 9. Re: JBoss AS7 and activemq connector
                          jaikiran

                          Jean-Pierre RIO wrote:

                           

                          So i got this working but (i don't know  who's fault it is, activemq or jboss), i had to modify the code so that it works

                          If somebody from amq or jboss read this, can you please react ?

                          It was the JBoss EJB integration code which was at fault. We have fixed that in the latest upstream code https://community.jboss.org/message/647977#647977, like Ed says.

                          • 10. Re: JBoss AS7 and activemq connector
                            jaikiran

                            And also, in org.apache.activemq.ra.ActiveMQEndpointWorker, i had to "unsynchronize" the run method (because JBoss checks it is not synchronized) :

                             

                            ...

                            connectWork = new Work() {

                                        long currentReconnectDelay = INITIAL_RECONNECT_DELAY;

                             

                                        public void release() {

                                            //

                                        }

                                        synchronized public void run() {

                                            currentReconnectDelay = INITIAL_RECONNECT_DELAY;

                                            MessageActivationSpec activationSpec = endpointActivationKey.getActivationSpec();

                            ...

                             

                            I don't know about this. What problems do you run into if you don't change that code?

                            • 11. Re: JBoss AS7 and activemq connector
                              jprio

                              Jaikiran,

                              I deployed the amq 5.5.0 rar and a MDB on the latest as7 nightly build and here is the stack :

                               

                               

                              10:22:38,280 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.AMQ_MDBs.jar" is using a private module ("org.jacorb:main") which may be chan

                              ged or removed in future versions without notice.

                              10:22:38,764 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) JBAS014142: Started message driven bean 'MDB' with 'activemq-rar-5.5.0' resource adapter

                              10:22:38,829 INFO  [org.apache.activemq.ra.ActiveMQEndpointWorker] (MSC service thread 1-4) Starting

                              10:22:38,832 ERROR [org.apache.activemq.ra.ActiveMQEndpointWorker] (MSC service thread 1-4) Work Manager did not accept work: : javax.resource.spi.work.WorkException: IJ000257: org.apache.ac

                              tivemq.ra.ActiveMQEndpointWorker$1: Run method is synchronized

                                      at org.jboss.jca.core.workmanager.WorkManagerImpl.verifyWork(WorkManagerImpl.java:686)

                                      at org.jboss.jca.core.workmanager.WorkManagerImpl.checkAndVerifyWork(WorkManagerImpl.java:656)

                                      at org.jboss.jca.core.workmanager.WorkManagerImpl.scheduleWork(WorkManagerImpl.java:485)

                                      at org.apache.activemq.ra.ActiveMQEndpointWorker.connect(ActiveMQEndpointWorker.java:271)

                                      at org.apache.activemq.ra.ActiveMQEndpointWorker.start(ActiveMQEndpointWorker.java:237)

                                      at org.apache.activemq.ra.ActiveMQResourceAdapter.endpointActivation(ActiveMQResourceAdapter.java:197)

                                      at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:151)

                                      at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44) [jboss-as-ee-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]

                                      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$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]

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

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

                              • 12. Re: JBoss AS7 and activemq connector
                                ned233

                                I just downloaded the latest snapshot (from 1/25/2012), and now I am getting this error too:  Run method is synchronized.

                                 

                                I really don't want to have to modify the ActiveMQ source code and re-jar like Jean-Pierre did.  Is there any chance this can be fixed from the JBoss side?

                                • 13. Re: JBoss AS7 and activemq connector
                                  jesper.pedersen

                                  It is a spec violation - so ActiveMQ will have to fix that.

                                   

                                  We need to be able to stop running Work instances, so the run/release methods can't be synchronized.

                                  • 14. Re: JBoss AS7 and activemq connector
                                    ned233

                                    OK, I have posted this as an issue to the ActiveMQ forum mailing list:  http://activemq.2283324.n4.nabble.com/ActiveMQEndpointWorker-run-method-cannot-be-synchronized-td4330542.html

                                    1 2 3 Previous Next