1 Reply Latest reply on May 22, 2012 10:40 AM by jmighion Branched to a new discussion.

    How do I deploy an MDB using CCDT and MQ resource adapter?

    jmighion

      On EAP 6 beta, I'm trying to deploy an MDB that is trying to use a CCDT to connect to MQ and use a resource adapter already deployed, but it never reads the queue manager name in the CCDT.  The resource adapter deploys fine, but when trying to deploy the jar with the MDBs fails.

       

      Standalone setup for the resource adapter:

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

                  <resource-adapters>

                      <resource-adapter>

                          <archive>

                              wmq.jmsra.rar

                          </archive>

                          <connection-definitions>

                              <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="java:jboss/eis/myMQCF" pool-name="wmq_jmsra_rar_pool">

                                  <pool>

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

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

                                  </pool>

                                  <security>

                                      <application/>

                                  </security>

                              </connection-definition>

                          </connection-definitions>

                      </resource-adapter>

                  </resource-adapters>

              </subsystem>

       

      It did have config-properties for host, channel, etc. but they were all local.

       

      ejb-jar.xml setup:

      <?xml version="1.0" encoding="UTF-8"?>

      <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1">

        <display-name>LocalPosStub </display-name>

        <enterprise-beans>

                  <message-driven>

                            <ejb-name>ejbName</ejb-name>

                            <ejb-class>com.package.ejbName</ejb-class>

                            <activation-config>

                                      <activation-config-property>

                                                <activation-config-property-name>destinationType</activation-config-property-name>

                                                <activation-config-property-value>javax.jms.Queue</activation-config-property-value>

                                      </activation-config-property>

                                      <activation-config-property>

                                                <activation-config-property-name>destination</activation-config-property-name>

                                                <activation-config-property-value>queueNameGoesHere</activation-config-property-value>

                                      </activation-config-property>

                                      <activation-config-property>

                                                <activation-config-property-name>ccdtURL</activation-config-property-name>

                                                <activation-config-property-value>file:/N:/.../AMQCLCHL.TAB</activation-config-property-value>

                                      </activation-config-property>

                            </activation-config>

                  </message-driven>

       

           ...more just like this

       

           </enterprise-beans>

      </ejb-jar>

       

      Stack Trace:

      13:45:22,294 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-12) MSC000001: Failed to start service jboss.deployment.unit."localPosStub-0.0.1-SNAPSHOT.jar".component.ItemInfoMDB.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."localPosStub-0.0.1-SNAPSHOT.jar".component.ItemInfoMDB.START: Failed to start service

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

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

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

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

      Caused by: java.lang.RuntimeException: javax.resource.spi.ResourceAdapterInternalException: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ2020: Failed to connect to queue manager '' with connection mode 'Client' and supplied CCDT URL 'file:/N:/.../AMQCLCHL.TAB', see linked exception for more information. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.

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

              at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)

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

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

              ... 3 more

      Caused by: javax.resource.spi.ResourceAdapterInternalException: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ2020: Failed to connect to queue manager '' with connection mode 'Client' and supplied CCDT URL 'file:/N:/.../AMQCLCHL.TAB', see linked exception for more information. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.

              at com.ibm.mq.connector.ResourceAdapterConnectionPool.createNewPoolEntryNoWrapper(ResourceAdapterConnectionPool.java:593)

              at com.ibm.mq.connector.ResourceAdapterConnectionPool.allocateConnection(ResourceAdapterConnectionPool.java:330)

              at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:453)

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

              ... 6 more

      Caused by: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ2020: Failed to connect to queue manager '' with connection mode 'Client' and supplied CCDT URL 'file:/N:/.../AMQCLCHL.TAB', see linked exception for more information. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.

              at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:496)

              at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)

              at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:440)

              at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7062)

              at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6453)

              at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:295)

              at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6230)

              at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6284)

              at com.ibm.mq.connector.ResourceAdapterConnectionPool.initializeJMSConnection(ResourceAdapterConnectionPool.java:474)

              at com.ibm.mq.connector.ResourceAdapterConnectionPool.createNewPoolEntryNoWrapper(ResourceAdapterConnectionPool.java:588)

              ... 9 more

      Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').

              at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)

              ... 17 more

      Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host '' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for  occurred. [1=java.net.ConnectException[Connection refused: connect],3=localhost]],3=,5=RemoteTCPConnection.connnectUsingLocalAddress]

              at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:2010)

              at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1227)

              at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:355)

              ... 16 more

      Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9213: A communications error for  occurred. [1=java.net.ConnectException[Connection refused: connect],3=localhost]

              at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:663)

              at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:991)

              at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:1112)

              at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:350)

              at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1599)

              ... 18 more

      Caused by: java.net.ConnectException: Connection refused: connect

              at java.net.PlainSocketImpl.socketConnect(Native Method) [rt.jar:1.6.0_26]

              at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) [rt.jar:1.6.0_26]

              at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) [rt.jar:1.6.0_26]

              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) [rt.jar:1.6.0_26]

              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) [rt.jar:1.6.0_26]

              at java.net.Socket.connect(Socket.java:529) [rt.jar:1.6.0_26]

              at java.net.Socket.connect(Socket.java:478) [rt.jar:1.6.0_26]

              at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection$5.run(RemoteTCPConnection.java:650)

              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_26]

              at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:643)

              ... 22 more

       

       

      I'm not sure if the resource adapter needs to point to the same ccdtURL for it's conneciton info too.  I tried that, but got the same error.  When I hardcode the values that the CCDT is supposed to return, everything works, so that's why I'm thinking it's a setup issue for the CCDTconnection.  The stack trace shows that it's trying to connect to a blank queue manager '', but it knows that its been supplied a CCDT.