How can I install the WebSphere MQ Resource Adapter (wmq.jmsra.rar) in JBoss 6.2 EAP?

Design . I have a queue manager (EXAMPLE.QM) with a server connection channel (example), a request queue (EXAMPLE.TEST.QUEUE) and a response queue (example. TEST.RESPOND). My application will use a message bean (MDB) that will listen on EXAMPLE.TEST.QUEUE. When a message arrives, the MDB is instantiated and the business logic that includes the request requests is executed, and then the response is pushed to the EXAMPLE.TEST.REPLY queue. This is one transaction. In case of crashes or crashes, the exception will be caught and everything will be canceled. I wanted to do a connection pooling for MQ and server side databases.

Customization: WebSphere MQ 7.0.1, JBoss 6.2 EAP, Java 1.7.0_21, IBM DB2 9.7

I got wmq.jmsra.rar from MQ_INSTALLATION_PATH \ java \ lib \ jca and I got com.ibm.mqetclient.jar too

According to Redhat Installation Guide , to support XATransactions. I repackaged wmq.jmsra.rar to include com.ibm.mqetclient.jar using command jar -uf wmq.jmsra.rar com.ibm.mqetclient.jar

You can skip the next paragraph and look at the below xml snippet for the same information.

After that, instead of manually deleting wmq.jmsra.rar to the JBoss deployment directory, I used the management console. Then I went ahead and added to the profile under Resource Adapters. I have set Archive to wmq.jmsra.rar and TX to XATransaction. Then I set the properties like this: logWriterEnabled is true, maxConnections is 10, reconnectionRetryCount is 5, traceLevel is 6, traceEnabled is true, reconnectionRetryInterval is 300000 and connectionConcurrency is 5. After that I added the connection definition. I named it WMQ_ConnectionFactory, JNDI is java: jboss / WMQ_ConnectionFactory and Class Connection is com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl. I am setting the properties like this: port - 1414, hostName - localhost, channel - EXAMPLE.CHANNEL, transportType - BINDINGS_THEN_CLIENT,failIfQuiesce is true and queueManager is EXAMPLE.QM. Then I added 2 Admin objects. 1st I named EXAMPLE_REQ_Queue, JNDI is java: jboss / EXAMPLE_REQ_Queue and class name is com.ibm.mq.connector.outbound.MQQueueProxy. I have the following properties: useJNDI is true, readAheadClosePolicy is ALL, startTimeout is 10000, destination is EXAMPLE.TEST.REQUEST and destinationType is javax.jms.Queue. The second admin object, which I named EXAMPLE_REP_Queue, the JNDI is java: jboss / EXAMPLE_REP-Queue, and the class name is com.ibm.mq.connector.outbound.MQQueueProxy. I gave it the following properties: failifQuiesce is true, baseQueueManagerName is EXAMPLE.QM, persistence is HIGH, encoding is NNN, baseQueueName is EXAMPLE.TEST.REPLY, targetClient is MQ and expiration is 300000.jboss / EXAMPLE_REQ_Queue and the class name is com.ibm.mq.connector.outbound.MQQueueProxy. I have the following properties: useJNDI is true, readAheadClosePolicy is ALL, startTimeout is 10000, destination is EXAMPLE.TEST.REQUEST and destinationType is javax.jms.Queue. The second admin object, which I named EXAMPLE_REP_Queue, the JNDI is java: jboss / EXAMPLE_REP-Queue, and the class name is com.ibm.mq.connector.outbound.MQQueueProxy. I gave it the following properties: failifQuiesce is true, baseQueueManagerName is EXAMPLE.QM, persistence is HIGH, encoding is NNN, baseQueueName is EXAMPLE.TEST.REPLY, targetClient is MQ and expiration is 300000.jboss / EXAMPLE_REQ_Queue and the class name is com.ibm.mq.connector.outbound.MQQueueProxy. I have the following properties: useJNDI is true, readAheadClosePolicy is ALL, startTimeout is 10000, destination is EXAMPLE.TEST.REQUEST and destinationType is javax.jms.Queue. The second admin object, which I named EXAMPLE_REP_Queue, the JNDI is java: jboss / EXAMPLE_REP-Queue, and the class name is com.ibm.mq.connector.outbound.MQQueueProxy. I gave it the following properties: failifQuiesce is true, baseQueueManagerName is EXAMPLE.QM, persistence is HIGH, encoding is NNN, baseQueueName is EXAMPLE.TEST.REPLY, targetClient is MQ, and expiration is 300000.which I named EXAMPLE_REP_Queue, JNDI is java: jboss / EXAMPLE_REP-Queue, and the class name is com.ibm.mq.connector.outbound.MQQueueProxy. I gave it the following properties: failifQuiesce is true, baseQueueManagerName is EXAMPLE.QM, persistence is HIGH, encoding is NNN, baseQueueName is EXAMPLE.TEST.REPLY, targetClient is MQ and expiration is 300000.which I named EXAMPLE_REP_Queue, JNDI is java: jboss / EXAMPLE_REP-Queue, and the class name is com.ibm.mq.connector.outbound.MQQueueProxy. I gave it the following properties: failifQuiesce is true, baseQueueManagerName is EXAMPLE.QM, persistence is HIGH, encoding is NNN, baseQueueName is EXAMPLE.TEST.REPLY, targetClient is MQ and expiration is 300000.

Here is a snippet of the standalone.xml file

<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>
                <config-property name="logWriterEnabled">
                    true
                </config-property>
                <config-property name="maxConnections">
                    10
                </config-property>
                <config-property name="traceEnabled">
                    true
                </config-property>
                <config-property name="traceLevel">
                    6
                </config-property>
                <config-property name="reconnectionRetryCount">
                    5
                </config-property>
                <config-property name="reconnectionRetryInterval">
                    300000
                </config-property>
                <config-property name="connectionConcurrency">
                    5
                </config-property>
                <connection-definitions>
                    <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/WMQ_ConnectionFacotry" enabled="true" pool-name="WMQ_ConnectionFactory">
                        <config-property name="port">
                            1414
                        </config-property>
                        <config-property name="hostName">
                            localhost
                        </config-property>
                        <config-property name="channel">
                            EXAMPLE.CHANNEL
                        </config-property>
                        <config-property name="failIfQuiesce">
                            true
                        </config-property>
                        <config-property name="transportType">
                            BINDINGS_THEN_CLIENT
                        </config-property>
                        <config-property name="queueManager">
                            EXAMPLE.QM
                        </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/EXAMPLE_REQ_Queue" enabled="true" use-java-context="false" pool-name="EXAMPLE_REQ_Queue">
                        <config-property name="useJNDI">
                            true
                        </config-property>
                        <config-property name="startTimeout">
                            10000
                        </config-property>
                        <config-property name="destination">
                            EXAMPLE.TEST.REQUEST
                        </config-property>
                        <config-property name="readAheadClosePolicy">
                            ALL
                        </config-property>
                    </admin-object>
                    <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/EXAMPLE_REP_Queue" enabled="true" use-java-context="false" pool-name="EXAMPLE_REP_Queue">
                        <config-property name="failIfQuiesce">
                            true
                        </config-property>
                        <config-property name="baseQueueManagerName">
                            EXAMPLE.QM
                        </config-property>
                        <config-property name="persistence">
                            HIGH
                        </config-property>
                        <config-property name="encoding">
                            NNN
                        </config-property>
                        <config-property name="baseQueueName">
                            EXAMPLE.TEST.REPLY
                        </config-property>
                        <config-property name="targetClient">
                            MQ
                        </config-property>
                        <config-property name="expiry">
                            300000
                        </config-property>
                    </admin-object>
                </admin-objects>
            </resource-adapter>
        </resource-adapters>
    </subsystem>

      

Problem: I am getting the following exception:

15: 54: 53,325 ERROR [org.jboss.msc.service.fail] (ResourceAdapterDeploymentService Message pool - 1) MSC000001: Failed to start jboss.ra.deployment service. "wmq.jmsra.rar": org. jboss.msc.service.StartException in jboss.ra.deployment service. "wmq.jmsra.rar": JBAS010446: Failed to start RA deployment [wmq.jmsra] on org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService $ 1.run (AbstractResource:Adapter.jeployment927Service) as -connector-7.3.0.Final-redhat-14.jar: 7.3.0.Final -redhat-14] at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145) [rt.jar: 1.7.0_21 ] to java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:615) [rt.jar: 1.7.0_21] to java.lang.Thread.run (Thread.java:722) [rt.jar: 1.7 ...0_21] at org.jboss.threads.JBossThread.run (JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar: 2.1.1.Final-redhat-1] Called by: org. jboss.jca.deployers.common.DeployException: IJ020060: Failed to inject: com.ibm.mq.connector.outbound.MQQueueProxy property: destination value: EXAMPLE.TEST.REQUEST at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer. initAdminObject (AbstractResourceAdapterDeployer.java:907) [ironjacamar-deployers-common-1.0.23.Final-redhat-1.jar: 1.0.23.Final-redhat-1] at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer. createObjectsAndInjectValue (AbstractResourceAdapterDeployer.java:2382) [ironjacamar-deployers-common-1.0.23.Final-redhat-1.jar: 1.0.23.Final-redhat-1] at org.jboss.as.connector.services.resourceadapters. deployment.ResourceAdapterXmlDeploymentService $ AS7RaXmlDeployer.doDeploy (ResourceAdapterXmlDeploymentService.java:185) [jboss-as-connector-7.3.0.Final-redhat-14.jar: 7.3.0. Final-RedHat-14] at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start (ResourceAdapterXmlDeploymentService.java:106) [jboss-as-connector-7.3.0.Final-redhat-14.jar: 7.3.0.Final- RedHat-14] 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_21] at java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:615) [rt.jar: 1.7.0_21] at java.lang.Thread.run (Thread.java:722) [rt.jar: 1.7.0_21] 15: 54: 53,343 INFO [org.jboss.as.server] (Controller boot stream) JBAS018559: Expanded "wmq.jmsra.rar" (runtime name: "wmq.jmsra.rar") 15: 54: 53,344 INFO [org.jboss.as .controller] (controller boot thread) JBAS014774: Service status report JBAS014777: Services that did not start: service jboss.ra.deployment. "Wmq.jmsra.rar": org.jboss.msc.service.StartException in jboss.ra.deployment service. "Wmq.jmsra.rar": JBAS010446: Failed to start RA deployment [wmq.jmsra]server] (Controller boot stream) JBAS018559: Expanded "wmq.jmsra.rar" (runtime name: "wmq.jmsra.rar") 15: 54: 53,344 INFO [org.jboss.as.controller] (controller boot stream) JBAS014774: Service status report JBAS014777: Services that did not start: service jboss.ra.deployment. "Wmq.jmsra.rar": org.jboss.msc.service.StartException in jboss.ra.deployment service. "Wmq.jmsra.rar": JBAS010446: Failed to start RA deployment [wmq.jmsra]server] (Controller boot stream) JBAS018559: Expanded "wmq.jmsra.rar" (runtime: "wmq.jmsra.rar") 15: 54: 53,344 INFO [org.jboss.as.controller] (controller boot stream) JBAS014774: Service status report JBAS014777: Services that did not start: service jboss.ra.deployment. "Wmq.jmsra.rar": org.jboss.msc.service.StartException in jboss.ra.deployment service. "Wmq.jmsra.rar": JBAS010446: Failed to start RA deployment [wmq.jmsra]StartException on jboss.ra.deployment service. "Wmq.jmsra.rar": JBAS010446: Failed to start RA deployment [wmq.jmsra]StartException on jboss.ra.deployment service. "Wmq.jmsra.rar": JBAS010446: Failed to start RA deployment [wmq.jmsra]

I assume the main part is called: org.jboss.jca.deployers.common.DeployException: IJ020060: failed to inject: com.ibm.mq.connector.outbound.MQQueueProxy property: destination value: EXAMPLE .TEST.REQUEST Before that I had the same error and instead it was saying destinationType value: javax.jms.Queue. Then I went ahead and removed this property and tried again and now I got this error. I'm not sure what to do next.

Tutorials I followed: IBM - WebSphere MQ Resource Adapter , Redhat Jboss Documentation - JCA Architecture chapter and Oracle - Message Driven Beans Java EE6 Tutorial

My reputation allows me to post 2 links, so the last two tutorials are not related. Any help would be greatly appreciated.

+3


source to share


2 answers


I ended up removing all properties causing the popup exception. The properties I was trying to set were for inbound communication, and it turned out that this is not exactly the right place to set them. Instead, they must be installed in the Bean Message Drive (MDB) deployment descriptor. The file is named ejb-jar.xml. Below is the following data:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
     version="3.0"
>
<enterprise-beans>
     <message-driven>
          <ejb-name>MyMDB</ejb-name>
          <ejb-class>com.foo.MyMDB</ejb-class>
          <messaging-type>javax.jms.MessageListener</messaging-type>
          <transaction-type>Container</transaction-type>
          <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>
                         EXAMPLE.TEST.REQUEST
                    </activation-config-property-value>
                </activation-config-property>
                <!--SET OTHER PROPERTIES-->
          </activation-config>
     </message-driven>
</enterprise-beans>
</ejb-jar>

      



Hope it helps.

0


source


I had slightly different problems deploying MQ RAR for JBoss, but the solution and procedure outlined here here should work for you. Specific files to look at are here . Files are descriptors iron-jacamar (jboss as JCA provider).



  • ra.xml : RAR WMQ descriptor
  • ironjacamar.xml : defines WMQ connection parameters and administration objects.
+1


source







All Articles