2 Replies Latest reply on May 16, 2017 11:36 AM by aniljpne

    unable to connect from JBoss EAP7 to websphere MQ

    aniljpne

      Hi,

       

      Can anyone suggest me the steps to create a connection between the Jboss EAP 7 and Websphere MQ?

      I created a resource adapter in standalone-full.xml and but it is failing to connect.

        • 1. Re: unable to connect from JBoss EAP7 to websphere MQ
          vrlgohel

          You  mentioned, failing to connect ? What is not able to connect ? What is the exception you are getting ? Here are the steps that you need to follow to integrate EAP 7 with WebSphere MQ.

           

          • First, deploy the resource adapter manually by copying the wmq.jmsra.rar file to the EAP_HOME/standalone/deployments/ directory.
          • Next, use the management CLI to add the resource adapter and configure it.

           

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:add(archive=wmq.jmsra.rar, transaction-support=XATransaction) 

          The above is for XA Transactions. When using transactions, be sure to supply the security domain of the XA recovery datasource, as in the example below.

          /subsystem=resource-adapters/resource-adapter=test/connection-definitions=test:write-attribute(name=recovery-security-domain,value=myDomain)

          For non-XA Transactions, you can use,

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:add(archive=wmq.jmsra.rar, transaction-support=NoTransaction) 

           

          • Add an admin-object for queues and configure its properties.
          • Add a connection definition for a managed connection factory and configure its properties .

           

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=queue-ao:add(class-name=com.ibm.mq.connector.outbound.MQQueueProxy, jndi-name=java:jboss/MQ.QUEUE.NAME)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=aoName/config-properties=baseQueueName:add(value=MQ.QUEUE.NAME)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=aoName/config-properties=baseQueueManagerName:add(value=MQ.QUEUE.MANAGER)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao:add(class-name=com.ibm.mq.connector.outbound.MQTopicProxy, jndi-name=java:jboss/MQ.TOPIC.NAME)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao/config-properties=baseTopicName:add(value=MQ.TOPIC.NAME)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao/config-properties=brokerPubQueueManager:add(value=MQ.QUEUE.MANAGER)

           

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/connection-definitions=mq-cd:add(class-name=com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl, jndi-name=java:jboss/MQ.CONNECTIONFACTORY.NAME, tracking=false)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/connection-definitions=mq-cd/config-properties=hostName:add(value=MQ.HOST.NAME)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/connection-definitions=mq-cd/config-properties=port:add(value=MQ.PORT)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/connection-definitions=mq-cd/config-properties=channel:add(value=MQ.CHANNEL.NAME)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/connection-definitions=mq-cd/config-properties=transportType:add(value=MQ.CLIENT)

          /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/connection-definitions=mq-cd/config-properties=queueManager:add(value=MQ.QUEUE.MANAGER)
          • 2. Re: unable to connect from JBoss EAP7 to websphere MQ
            aniljpne

            Thanks for your reply Gohel.

            I can not access management CLI because of access issue in my office laptop. Instead I will set the values in application specific standalone-full.xml file.

            standalone-full.xml file:

             

             

             

             

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

            <resource-adapters>

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

            <archive>

            </archive>

            <transaction-support>NoTransaction</transaction-support>

            <connection-definitions>

            <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/com.ibm.mq.jms.MQQueueConnectionFactoryFactory" enabled="true" tracking="false" use-java-context="false" pool-name="com.ibm.mq.jms.MQQueueConnectionFactoryFactory">

            <config-property name="channel">

                       ChannelName

            </config-property>

            <config-property name="hostName">

                      Hostname

            </config-property>

            <config-property name="transportType">

                     1   

            </config-property>

            <config-property name="queueManager">

                    QMgrName

            </config-property>

            <config-property name="port">

                    portname

            </config-property>

            </connection-definition>

            </connection-definitions>

            <admin-objects>

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

            <config-property name="baseQueueName">

                      QNAME

            </config-property>

            <config-property name="baseQueueManagerName">

                    QMgrName

            </config-property>

            </admin-object>

            </admin-objects>

            </resource-adapter>

            </resource-adapters>

            </subsystem>

             

            and in Jboss-web.xml file I delclared:

             

             

            jboss:jboss-web version="10.0" xmlns:jboss="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee jboss-web_10_0.xsd ">

            <jboss:context-root>/</jboss:context-root>

            <resource-ref>

            <description>JMS Connection for Unit Test</description>

            <res-ref-name>it00EventQueueFactory</res-ref-name>

            <res-type>javax.jms.QueueConnectionFactory</res-type>

            <res-auth>Container</res-auth>

            <res-sharing-scope>Shareable</res-sharing-scope>

            <jndi-name>java:/com.ibm.mq.jms.MQQueueConnectionFactoryFactory</jndi-name>

            </resource-ref>

             

             

            and this is the jndi look up in spring-config.xml file:

             

             

            jee:jndi-lookup id="it00EventConnectionFactory"  jndi-name="it00EventQueueFactory"  expected-type="javax.jms.QueueConnectionFactory" resource-ref="true" />

             

            But when running the server I am getting below error in the log.

             

             

            10:28:10,565 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "wmq.jmsra.rar" (runtime-name : "wmq.jmsra.rar")

             

            10:28:10,567 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "alerts_service.war" (runtime-name : "alerts_service.war")

             

            10:28:10,568 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report

             

            WFLYCTL0184:    New missing/unsatisfied dependencies:

             

                  service jboss.naming.context.java."com.ibm.mq.jms.MQQueueConnectionFactoryFactory" (missing) dependents: [service jboss.naming.context.java.module.alerts_service.alerts_service.env.it00EventQueueFactory]

             

             

            Please suggest me if you have any inputs.

             

            Thanks,

            AS