1 2 Previous Next 21 Replies Latest reply: Jul 12, 2013 11:03 AM by Manuel Bogner RSS

JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI

Bert Depaz Newbie

Hi,

 

I'm unable to bind an activemq resource-adapter to the jndi context.

I'm trying to build a simple client that can post a message to an ActiveMQ by using a container managed respource adapter.

 

I'm using

  • JBoss-AS-7.1.0.Final
  • ActiveMQ-5.4.3

 

 

I've deployed the activemq-rar-5.4.rar to the /standalone/deployments/ directory, I've configured the resource-adapter in the standalone-full.xml.

 

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

            <resource-adapters>

                <resource-adapter>

                    <archive>

                        activemq-rar-5.4.rar

                    </archive>

                    <transaction-support>XATransaction</transaction-support>

                    <config-property name="ServerUrl">

                        nio://localhost:61616

                    </config-property>

                    <connection-definitions>

                        <connection-definition class-name="javax.jms.QueueConnectionFactory" jndi-name="java:/activemq/QueueConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQConnectionPool">

                            <config-property name="ServerUrl">

                                nio://localhost:61616

                            </config-property>

                            <validation>

                                <background-validation>false</background-validation>

                                <background-validation-millis>0</background-validation-millis>

                            </validation>

                        </connection-definition>

                    </connection-definitions>

                </resource-adapter>

            </resource-adapters>

        </subsystem>

 

 

The adapter seems to have been deployed fine, except for the jndi binding. I have a MDB that listens to the configured queue, but I'm unable to implement a client that can post messages to the queue by obtaining the QueueConnectionFactory. Not using @Resource annotation, not using jndi-lookup. I can't see it in the JNDI tree either...

 

 

@Stateless

public class BusinessFacadeImpl implements BusinessFacade {

 

          /*

           * Using container injection to provide the container managed

           * resources.

           *

           * FAILS TO INJECT THE RESOURCES.

           */

          @Resource(mappedName="java:/activemq/QueueConnectionFactory")

          private static ConnectionFactory connectionFactory;

 

 

          @Resource(mappedName = "java:/MyQueue")

          private static Queue queue;

 

 

          public void addAsynchronousUsingInjectedResources(Person person) throws Exception {

                    Session session = null;

                    Connection connection = null;

                    try {

                              connection = connectionFactory.createConnection();

                              session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);

 

                              String text = "Create " + person + " : " + Thread.currentThread().getName() + " : " + this.hashCode();

                              TextMessage message = session.createTextMessage(text);

 

                              MessageProducer producer = session.createProducer(queue);

                              producer.setDeliveryMode(DeliveryMode.PERSISTENT);

                              producer.send(message);

                    } finally {

                              if (connection != null) {

                                        connection.close();

                              }

                              if (session != null) {

                                        session.close();

                              }

                    }

          }

 

 

          public void addAsynchronousViaJNDILoopkup(Person person) throws Exception {

                    try {

                              Context context = new InitialContext();

                              Object qcf = context.lookup("java:/activemq/QueueConnectionFactory");

 

                              /* Throws NameNotFoundException here */

 

                    } catch (Exception e) {

                              e.printStackTrace();

                              throw e;

                    }

          }

 

 

Why isn't it binding my connectionfactory to the jndi context?

  • 1. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Manuel Bogner Newbie

    Hi,

     

    I'am having the same problem and I couldn't find a solution yet.

     

    For inbound connections MDBs aren't working because of a bug in activemq-ra as stated in https://community.jboss.org/message/624681

     

    But also for outbound connection my lookup fails for the connection factory. Checking it up in the cli and the management console says that the jndi-name is set - have a look at

      http://localhost:9990/console/App.html#resource-adapters;name=activemq-ra.rar

    or in cli

      [standalone@localhost:9999 /] ls /subsystem=resource-adapters/resource-adapter=activemq-ra.rar/connection-definitions=ActiveMQConnectionPool

     

    Both say that the adapter is enabled but under http://localhost:9990/console/App.html#naming nothing shows up and in my application I get the same result as you.

     

    I'm using jboss-7.1.0-final, activemq-5.5.0 and the latest version of activemq-ra from http://repo1.maven.org/maven2/org/apache/activemq/activemq-rar/

     

    I extracted activemq-rar-5.5.1.rar zip file and named the folder activemq-ra.rar, moved the folder to the deployment folder of my jboss and touched a activemq-ra.rar.dodeploy. Seems to work but there in the log there are lines that make me think that somethin bad is going on

     

    21:57:31,318 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020001: Required license terms for file:/home/manuel/bin/jboss-as-7.1.0.Final/standalone/deployments/activemq-ra.rar/

    21:57:31,324 DEBUG [org.apache.activemq.ra.ActiveMQResourceAdapter] (MSC service thread 1-3) setting [serverUrl] to: tcp://localhost:61616

    21:57:31,324 DEBUG [org.apache.activemq.ra.ActiveMQResourceAdapter] (MSC service thread 1-3) setting [userName] to: defaultUser

    21:57:31,324 DEBUG [org.apache.activemq.ra.ActiveMQResourceAdapter] (MSC service thread 1-3) setting [password] property

    21:57:31,324 DEBUG [org.apache.activemq.ra.ActiveMQResourceAdapter] (MSC service thread 1-3) setting [useInboundSession] to: false

    21:57:31,325 DEBUG [org.apache.activemq.ra.ActiveMQResourceAdapter] (MSC service thread 1-3) setting [serverUrl] to: tcp://localhost:61616

    21:57:31,325 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020009: Invalid connection definition with class-name: javax.jms.ConnectionFactory

    21:57:31,325 DEBUG [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) No activation: org.apache.activemq.ra.ActiveMQManagedConnectionFactory

    21:57:31,326 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020009: Invalid connection definition with class-name: javax.jms.ConnectionFactory

    21:57:31,326 DEBUG [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) No activation: org.apache.activemq.ra.ActiveMQManagedConnectionFactory

    21:57:31,326 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020009: Invalid connection definition with class-name: javax.jms.ConnectionFactory

    21:57:31,326 DEBUG [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) No activation: org.apache.activemq.ra.ActiveMQManagedConnectionFactory

    21:57:31,350 DEBUG [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) No activation: org.apache.activemq.command.ActiveMQQueue

    21:57:31,351 DEBUG [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) No activation: org.apache.activemq.command.ActiveMQTopic

    ...

    21:57:33,347 DEBUG [org.jboss.as.security] (MSC service thread 1-3) Cannot create permissions with 'null' metaData for id=shop.war

     

    At the end follows this

     

    21:57:35,371 ERROR [org.apache.activemq.ra.ActiveMQEndpointWorker] (MSC service thread 1-1) Work Manager did not accept work: : javax.resource.spi.work.WorkException: IJ000257: org.apache.activemq.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:156)

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

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

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

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]

        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]

     

    which seems to be the mentioned activemq bug and makes MDB not working. And while running the following lines are logged:

     

    22:01:57,342 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) RecoverySecurityDomain was empty

    22:01:57,342 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) Subject for recovery was null

    22:04:07,348 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) RecoverySecurityDomain was empty

    22:04:07,349 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) Subject for recovery was null

    22:06:17,355 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) RecoverySecurityDomain was empty

    22:06:17,355 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) Subject for recovery was null

    22:08:27,363 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) RecoverySecurityDomain was empty

    ...

    22:23:37,400 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) Subject for recovery was null

    22:25:47,406 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) RecoverySecurityDomain was empty

    22:25:47,407 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) Subject for recovery was null

    22:27:33,917 DEBUG [org.jboss.jca.core.connectionmanager.pool.idle.IdleRemover] (IdleRemover) Notifying pools, interval: 900000

    22:27:57,412 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) RecoverySecurityDomain was empty

    22:27:57,412 DEBUG [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) Subject for recovery was null

     

    But why is my resource-adapter not available in jndi. I configured it in standalone.xml as followd

     

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

                <resource-adapters>

                    <resource-adapter>

                        <archive>

                            activemq-ra.rar

                        </archive>

                        <transaction-support>XATransaction</transaction-support>

                        <config-property name="ServerUrl">

                            tcp://localhost:61616

                        </config-property>

                        <connection-definitions>

                            <connection-definition class-name="javax.jms.ConnectionFactory" jndi-name="java:/ActiveMQConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQConnectionPool" use-ccm="true">

                                <config-property name="ServerUrl">

                                    tcp://localhost:61616

                                </config-property>

                                <xa-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>

                                </xa-pool>

                                <security>

                                    <application/>

                                </security>

                                <validation>

                                    <background-validation>true</background-validation>

                                    <background-validation-millis>10</background-validation-millis>

                                </validation>

                            </connection-definition>

                        </connection-definitions>

                    </resource-adapter>

                </resource-adapters>

            </subsystem>

     

    PLEASE help!

  • 2. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Jesper Pedersen Master

    You need to use the ManagedConnectionFactoery as the class-name attribute.

     

    You can use the RAR info tool (http://docs.jboss.org/ironjacamar/userguide/1.1/en-US/html/tools.html#tools_rarinfo) in IronJacamar 1.1.0.Alpha6 to get a deployment descriptor for the subsystem.

     

    Nightly snapshot of AS7 may have some fixes that you may want too...

  • 3. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Manuel Bogner Newbie

    Jesper, thanks for your hint. I used the script as you said and got the following descriptor (note: using mvn compile -X is great for getting a complete classpath ^^):

     

    <resource-adapters>

                    <resource-adapter>

                        <archive>activemq.rar</archive>

                        <config-property name="UseInboundSession">false</config-property>

                        <config-property name="UserName">sa</config-property>

                        <config-property name="Password"></config-property>

                        <config-property name="ServerUrl">tcp://localhost:61616</config-property>

                        <config-property name="BrokerXmlConfig" />

                        <config-property name="Clientid" />

                        <transaction-support>XATransaction</transaction-support>

                        <connection-definitions>

                            <connection-definition

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

                                enabled="true" jndi-name="java:jboss/eis/Connection" pool-name="Connection"

                                sharable="true" use-ccm="true" use-java-context="true">

                                <xa-pool>

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

                                    <max-pool-size>10</max-pool-size>

                                    <prefill>true</prefill>

                                    <use-strict-min>true</use-strict-min>

                                    <flush-strategy>FailingConnectionOnly</flush-strategy>

                                    <pad-xid>false</pad-xid>

                                    <wrap-xa-resource>true</wrap-xa-resource>

                                </xa-pool>

                                <security>

                                    <application />

                                </security>

                            </connection-definition>

                            <connection-definition

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

                                enabled="true" jndi-name="java:jboss/eis/QueueConnection"

                                pool-name="QueueConnection" sharable="true" use-ccm="true"

                                use-java-context="true">

                                <xa-pool>

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

                                    <max-pool-size>10</max-pool-size>

                                    <prefill>true</prefill>

                                    <use-strict-min>true</use-strict-min>

                                    <flush-strategy>FailingConnectionOnly</flush-strategy>

                                    <pad-xid>false</pad-xid>

                                    <wrap-xa-resource>true</wrap-xa-resource>

                                </xa-pool>

                                <security>

                                    <application />

                                </security>

                            </connection-definition>

                            <connection-definition

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

                                enabled="true" jndi-name="java:jboss/eis/TopicConnection"

                                pool-name="TopicConnection" sharable="true" use-ccm="true"

                                use-java-context="true">

                                <xa-pool>

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

                                    <max-pool-size>10</max-pool-size>

                                    <prefill>true</prefill>

                                    <use-strict-min>true</use-strict-min>

                                    <flush-strategy>FailingConnectionOnly</flush-strategy>

                                    <pad-xid>false</pad-xid>

                                    <wrap-xa-resource>true</wrap-xa-resource>

                                </xa-pool>

                                <security>

                                    <application />

                                </security>

                            </connection-definition>

                        </connection-definitions>

                        <admin-objects>

                            <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"

                                enabled="true" jndi-name="java:jboss/eis/ao/ActiveMQQueue"

                                pool-name="ActiveMQQueue" use-java-context="true">

                                <config-property name="PhysicalName">testQueue1</config-property>

                            </admin-object>

                            <admin-object class-name="org.apache.activemq.command.ActiveMQTopic"

                                enabled="true" jndi-name="java:jboss/eis/ao/ActiveMQTopic"

                                pool-name="ActiveMQTopic" use-java-context="true">

                                <config-property name="PhysicalName">testTopic1</config-property>

                            </admin-object>

                        </admin-objects>

                    </resource-adapter>

                </resource-adapters>

     

    With this and activemq.rar deployed the connectors start being initialized but then an exception occurs that tells me that the object is already bound to jndi which seems to be right as it is logged a few lines above:

     

    00:36:31,811 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [password] property

    00:36:31,811 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [serverUrl] to: tcp://localhost:61616

    00:36:31,811 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [useInboundSession] to: false

    00:36:31,811 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [userName] to: sa

    00:36:31,814 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:jboss/eis/TopicConnection

    ....

    00:36:31,876 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (MSC service thread 1-3) Attempting to prefill pool: QueueConnection

    00:36:31,877 DEBUG [org.jboss.jca.core.connectionmanager.pool.idle.IdleRemover] (MSC service thread 1-3) Register pool: SemaphoreArrayListManagedConnectionPool@5bf2545c[pool=QueueConnection] (interval=1800000)

    00:36:31,883 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) copying standard ResourceAdapter configuration properties

    00:36:31,887 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [clientid] to: undefined

    00:36:31,887 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [password] property

    00:36:31,887 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [serverUrl] to: tcp://localhost:61616

    00:36:31,887 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [useInboundSession] to: false

    00:36:31,887 DEBUG [org.apache.activemq.ra.ActiveMQManagedConnectionFactory] (MSC service thread 1-3) setting [userName] to: sa

    00:36:31,888 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:jboss/eis/TopicConnection

    00:36:31,891 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.ra.deployment."activemq.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."activemq.rar_1": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [activemq]

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

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

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

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]

        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]

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

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

        ... 5 more

    Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/home/manuel/bin/jboss-as-7.1.0.Final/standalone/tmp/vfs/temp34bdc3e7fe399a8c/activemq.rar-bddab689ff0ff18e/contents/

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

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

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

        ... 5 more

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

        at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

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

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

        ... 7 more

     

     

    Is this a bug or is there still a problem with my configuration? Is this the problem why you proposed to try a nightly build?

     

    https://community.jboss.org/thread/169842 doesn't really give an answere and trying it with the nightly build also resulted in the same exception.

  • 4. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Bert Depaz Newbie

    Jesper, Manuel,

     

    Thanks for the tips, but I'm still not getting there...

     

    • I've configured the resource-adapter with the ManagedConnectionFactory as you suggested.

     

                <resource-adapters>

                    <resource-adapter>

                        <archive>

                            activemq-rar-5.4.rar

                        </archive>

                        <config-property name="ServerUrl">

                            nio://localhost:61616

                        </config-property>

                        <transaction-support>XATransaction</transaction-support>

                        <connection-definitions>

                            <connection-definition

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

                                enabled="true" jndi-name="java:jboss/activemq/Connection" pool-name="Connection"

                                sharable="true" use-ccm="true" use-java-context="true">

                                <xa-pool>

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

                                    <max-pool-size>10</max-pool-size>

                                    <prefill>true</prefill>

                                    <use-strict-min>true</use-strict-min>

                                    <flush-strategy>FailingConnectionOnly</flush-strategy>

                                    <pad-xid>false</pad-xid>

                                    <wrap-xa-resource>true</wrap-xa-resource>

                                </xa-pool>

                                <security>

                                    <application />

                                </security>

                            </connection-definition>

                            <connection-definition

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

                                enabled="true" jndi-name="java:jboss/activemq/QueueConnection"

                                pool-name="QueueConnection" sharable="true" use-ccm="true"

                                use-java-context="true">

                                <xa-pool>

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

                                    <max-pool-size>10</max-pool-size>

                                    <prefill>true</prefill>

                                    <use-strict-min>true</use-strict-min>

                                    <flush-strategy>FailingConnectionOnly</flush-strategy>

                                    <pad-xid>false</pad-xid>

                                    <wrap-xa-resource>true</wrap-xa-resource>

                                </xa-pool>

                                <security>

                                    <application />

                                </security>

                            </connection-definition>

                        </connection-definitions>

                        <admin-objects>

                            <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"

                                enabled="true" jndi-name="java:jboss/eis/ao/ActiveMQQueue"

                                pool-name="ActiveMQQueue" use-java-context="true">

                                <config-property name="PhysicalName">testQueue1</config-property>

                            </admin-object>

                            <admin-object class-name="org.apache.activemq.command.ActiveMQTopic"

                                enabled="true" jndi-name="java:jboss/eis/ao/ActiveMQTopic"

                                pool-name="ActiveMQTopic" use-java-context="true">

                                <config-property name="PhysicalName">testTopic1</config-property>

                            </admin-object>

                        </admin-objects>

                    </resource-adapter>

     

     

     

    When I try to deploy the rar, it fails to deploy caused by ClassNotFoundExceptions, although the jar containing these classes is definitly inside of my rar file.

    Weird thing (I don't know if this is important): every time I try to restart, it's a different class that it can't find. Always classes from the activemq-core jar, which is inside of my rar.

     

     

    09:34:10,953 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "activem

    q-rar-5.4.rar"

    09:34:13,546 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-2) IJ020001: Required license ter

    ms for file:/C:/jboss/jboss-as-7.1.0.Final/standalone/tmp/vfs/tempf11747edb54a83d3/activemq-rar-5.4.rar-46452bd6c4dcf365

    /contents/

    09:34:13,625 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-2) IJ020001: Required license

    terms for file:/C:/jboss/jboss-as-7.1.0.Final/standalone/tmp/vfs/tempf11747edb54a83d3/activemq-rar-5.4.rar-46452bd6c4dcf

    365/contents/

    09:34:13,671 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-2) JBAS010406: Registered connection factor

    y java:jboss/activemq/QueueConnection

    09:34:13,687 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-2) JBAS010406: Registered connection factor

    y java:jboss/activemq/Connection

    09:34:13,687 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-2) JBAS010406: Registered connection factor

    y java:jboss/activemq/QueueConnection

    09:34:13,687 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.ra.depl

    oyment."activemq-rar-5.4.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."activemq-rar-5.4.r

    ar_1": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [activemq-ra

    r-5.4]

            at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploy

    mentService.java:126)

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-ms

    c-1.0.2.GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.G

    A.jar:1.0.2.GA]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]

            at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]

    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [activem

    q-rar-5.4]

            at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploy

    mentService.java:110)

            ... 5 more

    Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/C:/jboss/jboss-as-7.1.0.Fi

    nal/standalone/tmp/vfs/tempf11747edb54a83d3/activemq-rar-5.4.rar-46452bd6c4dcf365/contents/

            at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAd

    apterDeployer.java:2174)

            at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(Reso

    urceAdapterXmlDeploymentService.java:173)

            at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploy

    mentService.java:104)

            ... 5 more

    Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.connector.connection-factory.java:jboss/active

    mq/QueueConnection is already registered

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

    GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227) [jboss-msc-1.0.

    2.GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.2.GA.jar:1.0

    .2.GA]

            at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

     

     

            at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jbos

    s-msc-1.0.2.GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.2.GA.jar:1.0.2.G

    A]

            at org.jboss.as.connector.metadata.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.bin

    dConnectionFactory(AbstractResourceAdapterDeploymentService.java:260)

            at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAd

    apterDeployer.java:1946)

            ... 7 more

     

     

    09:34:13,718 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "activemq-rar-

    5.4.rar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.ra.deployment.\"activemq-rar-5.4

    .rar_1\"" => "org.jboss.msc.service.StartException in service jboss.ra.deployment.\"activemq-rar-5.4.rar_1\": org.jboss.

    msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [activemq-rar-5.4]"}}

    09:34:13,718 WARN  [org.jboss.modules] (JCA PoolFiller) Failed to define class org.apache.activemq.transport.TransportSe

    rverThreadSupport in Module "deployment.activemq-rar-5.4.rar:main" from Service Module Loader: java.lang.LinkageError: F

    ailed to link org/apache/activemq/transport/TransportServerThreadSupport (Module "deployment.activemq-rar-5.4.rar:main"

    from Service Module Loader)

            at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

            at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

            at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

            at org.jboss.modules.Module.loadModuleClass(Module.java:517)

            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

            at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]

            at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_03]

            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_03]

            at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

            at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

            at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

            at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

            at org.jboss.modules.Module.loadModuleClass(Module.java:517)

            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

            at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_03]

            at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) [rt.jar:1.7.0_03]

            at java.lang.Class.getConstructor0(Class.java:2714) [rt.jar:1.7.0_03]

            at java.lang.Class.newInstance0(Class.java:343) [rt.jar:1.7.0_03]

            at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.7.0_03]

            at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:61)

            at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:146)

            at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:201)

            at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:79)

            at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)

            at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)

            at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:185)

            at org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:79)

            at org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:61)

            at org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFact

    ory.java:169)

            at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventLi

    stener(SemaphoreArrayListManagedConnectionPool.java:758) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

            at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.fillToMin(SemaphoreArra

    yListManagedConnectionPool.java:703) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

            at org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFiller.java:97) [ironjacamar-core-impl-1.0.7

    .Final.jar:1.0.7.Final]

            at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]

    Caused by: java.lang.NoClassDefFoundError: org/apache/activemq/transport/TransportServerSupport

            at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]

            at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_03]

            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_03]

            at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

            at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

            ... 40 more

    Caused by: java.lang.ClassNotFoundException: org.apache.activemq.transport.TransportServerSupport from [Module "deployme

    nt.activemq-rar-5.4.rar:main" from Service Module Loader]

            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

            ... 45 more

     

     

    09:34:13,750 WARN  [org.jboss.modules] (JCA PoolFiller) Failed to define class org.apache.activemq.transport.tcp.TcpTran

    sportServer in Module "deployment.activemq-rar-5.4.rar:main" from Service Module Loader: java.lang.LinkageError: Failed

    to link org/apache/activemq/transport/tcp/TcpTransportServer (Module "deployment.activemq-rar-5.4.rar:main" from Service

    Module Loader)

            at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

            at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

            at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

            at org.jboss.modules.Module.loadModuleClass(Module.java:517)

            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

            at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_03]

            at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) [rt.jar:1.7.0_03]

            at java.lang.Class.getConstructor0(Class.java:2714) [rt.jar:1.7.0_03]

            at java.lang.Class.newInstance0(Class.java:343) [rt.jar:1.7.0_03]

            at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.7.0_03]

            at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:61)

            at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:146)

            at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:201)

            at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:79)

            at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)

            at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)

            at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:185)

            at org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:79)

            at org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:61)

            at org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFact

    ory.java:169)

            at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventLi

    stener(SemaphoreArrayListManagedConnectionPool.java:758) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

            at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.fillToMin(SemaphoreArra

    yListManagedConnectionPool.java:703) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

            at org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFiller.java:97) [ironjacamar-core-impl-1.0.7

    .Final.jar:1.0.7.Final]

            at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]

    Caused by: java.lang.NoClassDefFoundError: org/apache/activemq/transport/TransportServerThreadSupport

            at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]

            at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_03]

            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_03]

            at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

            at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

            ... 27 more

    Caused by: java.lang.ClassNotFoundException: org.apache.activemq.transport.TransportServerThreadSupport from [Module "de

    ployment.activemq-rar-5.4.rar:main" from Service Module Loader]

            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

            ... 32 more

     

     

    09:34:13,765 ERROR [stderr] (JCA PoolFiller) Exception in thread "JCA PoolFiller" java.lang.NoClassDefFoundError: org/ap

    ache/activemq/util/IOExceptionSupport

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.transport.TransportFactory.findTransportFactory(T

    ransportFactory.java:204)

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.transport.TransportFactory.connect(TransportFacto

    ry.java:79)

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveM

    QConnectionFactory.java:243)

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio

    n(ActiveMQConnectionFactory.java:258)

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.ActiveMQConnectionFactory.createConnection(Active

    MQConnectionFactory.java:185)

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(Activ

    eMQConnectionSupport.java:79)

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(Activ

    eMQConnectionSupport.java:61)

    09:34:13,765 ERROR [stderr] (JCA PoolFiller)    at org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManaged

    Connection(ActiveMQManagedConnectionFactory.java:169)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManag

    edConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:758)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManag

    edConnectionPool.fillToMin(SemaphoreArrayListManagedConnectionPool.java:703)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFill

    er.java:97)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at java.lang.Thread.run(Thread.java:722)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller) Caused by: java.lang.ClassNotFoundException: org.apache.activemq.util.IOExc

    eptionSupport from [Module "deployment.activemq-rar-5.4.rar:main" from Service Module Loader]

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:

    190)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Con

    currentClassLoader.java:468)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(Concu

    rrentClassLoader.java:456)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentCl

    assLoader.java:398)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoad

    er.java:120)

    09:34:13,781 ERROR [stderr] (JCA PoolFiller)    ... 12 more

    09:34:15,281 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment activemq-rar

    -5.4.rar in 1568ms

    09:34:15,281 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

    JBAS014777:   Services which failed to start:      service jboss.ra.deployment."activemq-rar-5.4.rar_1": org.jboss.msc.s

    ervice.StartException in service jboss.ra.deployment."activemq-rar-5.4.rar_1": org.jboss.msc.service.StartException in a

    nonymous service: JBAS010446: Failed to start RA deployment [activemq-rar-5.4]

     

     

    09:34:15,281 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite oper

    ation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jbos

    s.ra.deployment.\"activemq-rar-5.4.rar_1\"" => "org.jboss.msc.service.StartException in service jboss.ra.deployment.\"ac

    tivemq-rar-5.4.rar_1\": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deploy

    ment [activemq-rar-5.4]"}}}}

  • 5. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Bert Depaz Newbie

    I'm not sure if this makes any sence:

     

    • As long as I don't have the connection-definitions defined in my resource-adapter in the standalone.xml, it starts up fine, it deploys fine ... only the connections are not bound to jndi. The activemq.rar file is in the /standalone/deployments/ directory.
    • As soon as I add the connection-definitions to my standalone.xml with the JNDI bindings and such configured, it no longer is able to start the resource-adapter: it starts complaining about missing classes, which are in fact in the rar under /standalone/deployments.

     

    It seems to me that by configuring the connection-definitions in the standalone.xml, the container is in fact trying to start the RA, but at that point the rar under deployments is not yet loaded into the classpath (?)

    Does that make any sence?

     

    So my new question: is it correct to deploy the rar inside the /standalone/deployments/ folder?

  • 6. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Sebastien Col Newbie

    Hi Manuel,

    I've been working on this integration yesterday. I encountered the same problem, JBoss apparently trying to deploy the resource adapter twice. I finally had it working, following ActiveMQ's JBoss integration procedure, which tells to unzip the RAR file into the deployments folder and rename this folder after the name of the RAR file.

    My JBoss started like a charm.

    Hope this helps.

  • 7. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Manuel Bogner Newbie

    Hi Sebastien,

     

    I tried to unzip the folder and name it after the file. But still the same exception during startup:

     

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

     

    First I thought it works, but then I saw that the adapter is not started automatically during startup. So you have to create a .dodeploy file to get it started which fails the same way as with a .rar file.

     

    Best Regards,

    Manuel

  • 8. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Thorsten Hoeger Newbie

    I got this working with the attached files in the META-INF folder of the activemq rar

    When using these files there is no need to modify the standalone.xml

     

    The problem with the "synchronized" method is fixed in the 5.6 Snapshot build.

  • 9. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Jesper Pedersen Master

    Thorsten, I have fixed JBJCA-766 - thanks for tracking the problem down.

  • 10. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Manuel Bogner Newbie

    Hi,

     

    I just tried the proposed solution. This deploys an embedded broker but I want an external one. So I switched to activemq.rar 5.5.6-snapshot, changed Thorsten's  attached files and adapted my mdb a bit. Now everything seems to be fine and receives messages from my external activemq. Thx to all supporters! I think this topic can be changed to answered though this seems to be more like a workaround than a real solution to a broken resource-adapter config in standalone.xml..

     

    RemoteActiveMQConsumer.java:

    import javax.ejb.ActivationConfigProperty;

    import javax.ejb.MessageDriven;

    import javax.inject.Inject;

    import javax.jms.Message;

    import javax.jms.MessageListener;

     

    import org.jboss.ejb3.annotation.ResourceAdapter;

    import org.jboss.logging.Logger;

     

    /**

     

    • @author manuel

     

    */

    @MessageDriven(activationConfig = {

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

            @ActivationConfigProperty(propertyName = "destination", propertyValue = "activemq/queue/TestQueue") })

    @ResourceAdapter("activemq.rar")

    public class RemoteActiveMQConsumer implements MessageListener {

     

        @Inject

        private Logger log;

     

        @Override

        public void onMessage(Message msg) {

            log.debugf("received message: %s", msg);

        }

     

    }

     

  • 11. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Paulo Ricardo Ribeiro Newbie

    Hello,

     

    First of all I want to thank you all for the help.

    Following the tips I've managed to deploy the activemq.rar and i'ts up and running. I tryed to access some queues using spring and jndi, and it's also working.

     

    When I've first deployed the activemq.rar I had to create an empty file "activemq.rar.dodeploy" or else the server wouldn't deploy it.

     

    So my question is, is there a way to "force" the server to do the deploy of the rar (via some configuration files?), or do I have to create the activemq.rar.dodeploy again, when I stop the server, clean the temporary files and then restart it?

     

    I have my database datasources configured on the standalone.xml, but, as I've seem in the begining of this topic, having the activemq.rar configured there is causing some problems, that is why I'm asking this.

     

    Thanks a lot

  • 12. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Manuel Bogner Newbie

    Hi,

     

    That's exactly the way I did it. https://blog.coffeebeans.at/?p=230#comment-22

    You only have to create the file once. So i don't see a problem here.

     

    Cheers

  • 13. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Manuel Bogner Newbie

    Ps: the resulting ...deployed file does the trick.

  • 14. Re: JBoss AS7 + ActiveMQ: Unable to bind QueueConnectionFactory to JNDI
    Paulo Ricardo Ribeiro Newbie

    My main fear is that on the production environment for some reason, someone clears the deployemnts folder and forgets to create the "dodeploy" file.

    But, besides that detail, I think that's a great solution.

     

    Cheers

1 2 Previous Next