2 Replies Latest reply on Jul 28, 2015 4:23 PM by moschti

    Need help with setting up IBM MQ with JBoss 7.1.1.Final

    bimales

      We're trying to setup IBM Message Queue with JBoss-7.1.1.Final. Earlier, the MQ was working nicely with JBoss 5.

      What is happening is, we are getting one Exception at server boot (regarding wmq.jmsra.rar, the exception is written at the end), and then after deploying our MDB, it says that the MDB has been started with Resource Adapter 'wmq.jmsra.rar'.

       

      Here's the relevant part of standalone-full.xml:

       

      <resource-adapter>
          <archive>
              wmq.jmsra.rar
          </archive>
          <transaction-support>XATransaction</transaction-support>
          <connection-definitions>
              <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="jms/rc2wfp/responseQueueCF" enabled="true" use-java-context="false" pool-name="responseQueueCF">
                  <config-property name="port">
                      1427
                  </config-property>
                  <config-property name="hostName">
                      xxx.xxx.xxx
                  </config-property>
                  <config-property name="username">
                      userabcdefgh
                  </config-property>
                  <config-property name="password">
                      pwdabcdefgh
                  </config-property>
                  <config-property name="channel">
                      RC2WFP.SVRCONN
                  </config-property>
                  <config-property name="transportType">
                      CLIENT
                  </config-property>
                  <config-property name="queueManager">
                      QD_CNM
                  </config-property>
              </connection-definition>
          </connection-definitions>
          <admin-objects>
              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="jms/rc2wfp/responseQueue" enabled="true" use-java-context="true" pool-name="responseQueue">
                  <config-property name="baseQueueManagerName">
                      QD_CNM
                  </config-property>
                  <config-property name="baseQueueName">
                      RC2WFP.DEV.RESP.QUEUE
                  </config-property>
              </admin-object>
          </admin-objects>
      </resource-adapter>
      

       

       

       

      The message driven Bean:

       

      package com.ejb.mdb;
      
      
      import java.io.IOException;
      import java.io.StringReader;
      import java.io.StringWriter;
      
      
      import javax.ejb.EJBException;
      import javax.ejb.MessageDrivenBean;
      import javax.ejb.MessageDrivenContext;
      
      
      import javax.jms.MessageListener;
      import javax.jms.Message;
      import javax.jms.TextMessage;
      import javax.jms.JMSException;
      
      
      import javax.xml.parsers.DocumentBuilder;
      import javax.xml.parsers.DocumentBuilderFactory;
      import javax.xml.parsers.ParserConfigurationException;
      
      
      import org.w3c.dom.Document;
      import org.xml.sax.InputSource;
      import org.xml.sax.SAXException;
      
      
      public class RCMQMDB implements MessageListener, MessageDrivenBean {
      
      
          public RCMQMDB() {
              System.out.println("Insie RCMQMDB Bean constructor");
          }
      
      
          public void onMessage(Message message) {
              System.out.println("RCMQMDB.onMessage()");
              System.out.println("Insie onMessage");
              String messageStr;
              StringWriter writer = new StringWriter();
              try {
                  TextMessage txtMessage = (TextMessage) message;
                  System.out.println("mesage id is " + txtMessage.getJMSMessageID());
                  messageStr = txtMessage.getText();
                  System.out.println("response String is *********************");
                  System.out.println(messageStr);
                  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                  factory.setNamespaceAware(true);
                  DocumentBuilder builder = factory.newDocumentBuilder();
                  StringReader reader = new StringReader(writer.toString());
                  Document rootResponseDoc = builder.parse(new InputSource(reader));
              } catch (JMSException e) {
                  e.printStackTrace();
              } catch (ParserConfigurationException e) {
                  e.printStackTrace();
              } catch (SAXException e) {
                  e.printStackTrace();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
      
      
          public void ejbCreate() {
              System.out.println("EJB RCMQMDB Created!");
          }
      
      
          public void ejbRemove() {
              System.out.println("EJB RCMQMDB Destroyed!");
          }
      
      
          public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
              System.out.println("RCMQMDB.setMessageDrivenContext Called!");
          }
      }
      

       

       

       

       

       

      The jboss-ejb3.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
                     xmlns="http://java.sun.com/xml/ns/javaee" xmlns:tx="urn:trans-timeout"
                     xmlns:mdb="urn:resource-adapter-binding"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="urn:clustering:1.0"
                     xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
                     http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
                     http://java.sun.com/xml/ns/javaee 
                     http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd
                     urn:trans-timeout
                     http://www.jboss.org/j2ee/schema/trans-timeout-1_0.xsd"
                     version="3.1" impl-version="2.0">
          <display-name>RCMQMDB</display-name>
          <enterprise-beans>
              <message-driven>
                  <description>Message Driven Bean</description>
                  <display-name>RapidConnectMessageQueueMDB</display-name>
                  <ejb-name>RCMQMDB</ejb-name>
                  <ejb-class>com.ejb.mdb.RCMQMDB</ejb-class>
                  <transaction-type>Container</transaction-type>
                  <activation-config> 
                      <activation-config-property>
                          <activation-config-property-name>destination</activation-config-property-name>
                          <activation-config-property-value>jms/rc2wfp/responseQueue</activation-config-property-value>
                      </activation-config-property>
                      <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>useJNDI</activation-config-property-name> 
                          <activation-config-property-value>true</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property> 
                          <activation-config-property-name>queueManager</activation-config-property-name> 
                          <activation-config-property-value>QD_CNM</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property> 
                          <activation-config-property-name>transportType</activation-config-property-name> 
                          <activation-config-property-value>CLIENT</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property> 
                          <activation-config-property-name>hostName</activation-config-property-name> 
                          <activation-config-property-value>xxx.xxx.xxx</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property> 
                          <activation-config-property-name>port</activation-config-property-name> 
                          <activation-config-property-value>1427</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property> 
                          <activation-config-property-name>channel</activation-config-property-name> 
                          <activation-config-property-value>RC2WFP.SVRCONN</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property> 
                          <activation-config-property-name>userName</activation-config-property-name> 
                          <activation-config-property-value>userabcdefgh</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property> 
                          <activation-config-property-name>password</activation-config-property-name> 
                          <activation-config-property-value>pwdabcdefgh</activation-config-property-value> 
                      </activation-config-property> 
                      <activation-config-property>
                          <activation-config-property-name>acknowledgeMode</activation-config-property-name>
                          <activation-config-property-value>CLIENT_ACKNOWLEDGE</activation-config-property-value>
                      </activation-config-property>
                  </activation-config>
                  <resource-ref>
                      <res-ref-name>jms/rc2wfp/requestQueueCF</res-ref-name>
                      <lookup-name>java:/jms/rc2wfp/requestQueueCF</lookup-name>
                      <res-type>javax.jms.ConnectionFactory</res-type>
                      <res-auth>Container</res-auth>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/rc2wfp/responseQueueCF</res-ref-name>
                      <lookup-name>java:/ConnectionFactory</lookup-name>
                      <res-type>javax.jms.ConnectionFactory</res-type>
                      <res-auth>Container</res-auth>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/rc2wfp/requestQueue</res-ref-name>
                      <lookup-name>java:/jms/rc2wfp/requestQueue</lookup-name>
                      <res-type>javax.jms.Queue</res-type>
                      <res-auth>Container</res-auth>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/rc2wfp/responseQueue</res-ref-name>
                      <lookup-name>java:/jms/rc2wfp/responseQueue</lookup-name>
                      <res-type>javax.jms.Queue</res-type>
                      <res-auth>Container</res-auth>
                  </resource-ref>
              </message-driven>
          </enterprise-beans>
          <assembly-descriptor>
              <container-transaction>
                  <method>
                      <ejb-name>RCMQMDB</ejb-name>
                      <method-name>onMessage</method-name>
                      <method-params>
                          <method-param>javax.jms.Message</method-param>
                      </method-params>
                  </method>
                  <trans-attribute>Required</trans-attribute>
              </container-transaction>
              <mdb:resource-adapter-binding>
                  <ejb-name>RCMQMDB</ejb-name>
                  <mdb:resource-adapter-name>wmq.jmsra.rar</mdb:resource-adapter-name>
              </mdb:resource-adapter-binding>
          </assembly-descriptor>
      </jboss:ejb-jar>
      
      
      

       

       

      And the Exception relating to the wmq.jmsra.rar at server boot is:

       

      com.ibm.msg.client.commonservices.CSIException: The call could not be completed because CommonServices has not been initialized.
      

       

      From what we found, this has something to do with the adapter's licensing. Another question would be, could this be responsible for the MDB not working? If not, what are we missing?

       

      P.S. We've been at it for four days now. Any help would be greatly appreciated...