3 Replies Latest reply on Nov 11, 2016 5:13 AM by igarashitm

    JCA Binding with WMQ Resource Adapter Fuse Service Works 6.0

    ravi21588

      Hi All,

       

      i am trying to connect to IBM MQ using JCA Adapter,i have done the configuration for the resource adapter subsystem as mentioned in JBoss Documentation.

       

      below is the configuration for the service binding.

       

      <sca:service name="GGOutAckService" promote="GGOutAck/GGOutAckService">

            <sca:interface.java interface="com.company.esb.common.services.StringMessageService"/>

            <jca:binding.jca name="jca1">

              <jca:inboundConnection>

                <jca:resourceAdapter name="wmq.jmsra.rar"/>

                <jca:activationSpec>

                  <jca:property name="destinationType" value="javax.jms.Queue"/>

                  <jca:property name="destination" value="SOURCE.DESTINATION.SEARCH.OUT"/>

                </jca:activationSpec>

              </jca:inboundConnection>

              <jca:inboundInteraction>

                <jca:listener>javax.jms.MessageListener</jca:listener>

                <jca:endpoint type="org.switchyard.component.jca.endpoint.JMSEndpoint"/>

              </jca:inboundInteraction>

            </jca:binding.jca>

          </sca:service>

       

       

       

      WMQ is located in different server and i have specified the configuration in resource adapter subsystem.

      Resource Adapter subsystem configuration:

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

                  <resource-adapters>

                      <resource-adapter id="wmq.jmsra.rar">

                          <archive>

                              wmq.jmsra.rar

                          </archive>

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

                          <connection-definitions>

                              <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:/DevMQConnectionFactory" enabled="true" pool-name="java:/DevMQConnectionFactory">

                               <config-property name="port">

                                      15501

                                  </config-property>

                                  <config-property name="hostName">

                                      GLOBALDV.COMPANY.PARENTCOMPANY

                                  </config-property>

                                  <config-property name="username">

                                      DVEBIH

                                  </config-property>

                                  <config-property name="sslCipherSuite">

                                      TLS_RSA_WITH_AES_128_CBC_SHA256

                                  </config-property>

                                  <config-property name="channel">

                                      DTE.SC.SSL

                                  </config-property>

                                  <config-property name="transportType">

                                      CLIENT

                                  </config-property>

                                  <config-property name="queueManager">

                                      DTE01

                                  </config-property>

                                  <security>

                                      <application/>

                                  </security>

                                  <validation>

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

                                  </validation>

                              </connection-definition>

                          </connection-definitions>

                          <admin-objects>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.DESTINATION.SEARCH.IN" enabled="true" use-java-context="false" pool-name="SOURCE.DESTINATION.SEARCH.IN"/>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.DESTINATION.WRITE.IN" enabled="true" use-java-context="false" pool-name="SOURCE.DESTINATION.WRITE.IN"/>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.DESTINATION.READ.IN" enabled="true" use-java-context="false" pool-name="SOURCE.DESTINATION.READ.IN"/>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.DESTINATION.WRITE.OUT" enabled="true" use-java-context="false" pool-name="SOURCE.DESTINATION.WRITE.OUT"/>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.DESTINATION.READ.OUT" enabled="true" use-java-context="false" pool-name="SOURCE.DESTINATION.READ.OUT"/>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.APLUS.WRITE.OUT" enabled="true" use-java-context="false" pool-name="SOURCE.APLUS.WRITE.OUT"/>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.DESTINATION.SEARCH.OUT" enabled="true" use-java-context="false" pool-name="SOURCE.DESTINATION.SEARCH.OUT"/>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/SOURCE.APLUS.WRITE.IN" enabled="true" use-java-context="false" pool-name="SOURCE.APLUS.WRITE.IN"/>

                          </admin-objects>

                      </resource-adapter>

                  </resource-adapters>

              </subsystem>

       

       

       

      Iam getting below error in logs.JCA Binding is trying to locate the server in localhost 1414 - port number.

       

      I have not specified the connection factory in the service binding.

       

      Logs:

       

      15:53:38,793 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC000001: Failed to start service jboss.deployment.unit."GGInWrite.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."GGInWrite.jar".SwitchYardService: org.switchyard.SwitchYardExce

      ption: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.

              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:84)

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

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

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]

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

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

      Caused by: org.switchyard.SwitchYardException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failu

      re.

              at org.switchyard.component.jca.deploy.InboundHandler.doStart(InboundHandler.java:60)

              at org.switchyard.deploy.BaseServiceHandler.start(BaseServiceHandler.java:60)

              at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:623)

              at org.switchyard.deploy.internal.Deployment.start(Deployment.java:145)

              at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:127)

              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:77)

              ... 5 more

      Caused by: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.

              at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:134)

              at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:105)

              at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:315)

              at com.ibm.mq.connector.inbound.MessageEndpointDeployment.acquireConnection(MessageEndpointDeployment.java:284)

              at com.ibm.mq.connector.inbound.MessageEndpointDeployment.<init>(MessageEndpointDeployment.java:233)

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

              at org.switchyard.component.jca.deploy.InboundHandler.doStart(InboundHandler.java:58)

              ... 10 more

      Caused by: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'localhost(1414)'.

      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:479)

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

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

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

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

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

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

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

              at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:220)

              ... 14 more

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

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

              ... 21 more

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

      ,5=Socket.connect]],3=localhost(1414),5=RemoteTCPConnection.connnectUsingLocalAddress]

              at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2091)

              at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1226)

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

              ... 20 more

      Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9213: A communications error for 'TCP' occurred. [1=java.net.ConnectException[Connection refused: connect],3=connnectUsingLocalAddress,4=TCP,5=Socket.connect]

              at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:861)

              at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1302)

              at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:717)

              at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:400)

              at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:299)

              at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:164)

              at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1615)

              ... 22 more

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

              at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) [rt.jar:1.7.0_80]

              at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) [rt.jar:1.7.0_80]

              at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) [rt.jar:1.7.0_80]

              at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) [rt.jar:1.7.0_80]

              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) [rt.jar:1.7.0_80]

              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) [rt.jar:1.7.0_80]

              at java.net.Socket.connect(Socket.java:579) [rt.jar:1.7.0_80]

              at java.net.Socket.connect(Socket.java:528) [rt.jar:1.7.0_80]

              at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:846)

              at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:840)

              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_80]

              at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:838)

              ... 28 more