12 Replies Latest reply on Aug 10, 2014 10:18 PM by Justin Bertram

    MDB not consuming messages from Websphere MQ in 7.1.1.Final

    holgum Newbie

      Having problems trying to get MDB to consume messages from WebSphere MQ.

       

      I followed the instructions here: https://access.redhat.com/knowledge/ja/node/88823    (which are also reflected in various other posts I found on this forum)

       

      No errors on startup, and I can see a connection in MQ Explorer when when JBoss starts up, but messages just sit there on the queue and are not received by MDB.

       

      I turned on the tracing for wmq.jmsra.rar in standalone.conf:

      JAVA_OPTS="$JAVA_OPTS -DtraceEnabled=true -DtraceDestination=System.out -DtraceLevel=11 -DlogWriterEnabled=true"


      and I get a lot of FFDC files with the following:

      ------------------------------------------------------

      |   Exception    :-  ExceptionDepth is 2

      |   Exception    :- 

      |   |   Cause:1       :-  com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'deliver'.

      |   |   The JMS specification does not permit the use of a session for synchronous methods when asynchronous message delivery is running.

      |   |   Create a separate session if you wish to use both synchronous methods and asynchronous delivery simultaneously.

      |   |   Message:1     :-  JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'deliver'.

      |   |   StackTrace:1  :-  com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'deliver'.

      |   |   The JMS specification does not permit the use of a session for synchronous methods when asynchronous message delivery is running.

      |   |   Create a separate session if you wish to use both synchronous methods and asynchronous delivery simultaneously.

      |   |           at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)

      |   |           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

      |   |           at java.lang.reflect.Constructor.newInstance(Unknown Source)

      |   |           at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:314)

      |   |           at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:228)

      |   |           at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:104)

      |   |           at com.ibm.msg.client.jms.internal.JmsSessionImpl.deliver(JmsSessionImpl.java:2786)

      |   |           at com.ibm.mq.jms.MQSession.deliver(MQSession.java:1068)

      |   |           at com.ibm.msg.client.jms.internal.JmsConnectionConsumerImpl$JmsMessageReferenceHandlerImpl.endDeliverInternal(JmsConnectionConsumerImpl.java:399)

      |   |           at com.ibm.msg.client.jms.internal.JmsConnectionConsumerImpl$JmsMessageReferenceHandlerImpl.handleMessageReference(JmsConnectionConsumerImpl.java:456)

      |   |           at com.ibm.msg.client.jms.internal.JmsConnectionImpl$JmsProviderMessageRefHandler.handleMessageReference(JmsConnectionImpl.java:1484)

      |   |           at com.ibm.msg.client.wmq.internal.WMQConnectionBrowser$WMQConnectionBrowserShadow.consumer(WMQConnectionBrowser.java:856)

      |   |           at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.driveConsumer(RemoteProxyQueue.java:4217)

      |   |           at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.deliverMsgs(RemoteProxyQueue.java:4811)

      |   |           at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.deliverMsgsReconnectable(RemoteDispatchThread.java:549)

       

       


      Has anyone else seen this?

       

       

      MDB annotated as follows:

      ----------------------------------------

      @MessageDriven(name = "MyMDB", activationConfig = {

              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

              @ActivationConfigProperty(propertyName = "destination", propertyValue = "QUEUE1"),

              @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),

              @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QMA"),

              @ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),

              @ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),

              @ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),

              @ActivationConfigProperty(propertyName = "channel", propertyValue = "JBOSS.SVRCONN"),

              @ActivationConfigProperty(propertyName = "messagingType", propertyValue = "javax.jms.MessageListener")

       

               })

      @ResourceAdapter(value = "wmq.jmsra.rar")

      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

       

      public class MyMDB implements MessageListener {

          public MyMDB() {

              // TODO Auto-generated constructor stub

          }

       

          public void onMessage(Message message) {

              // TODO Auto-generated method stub

              System.out.println("*** GOT MQ MESSAGE!");

              TextMessage textMessage = (TextMessage) message;

              try {

                                    System.out.println(textMessage.getText());

                          } catch (JMSException e) {

             e.printStackTrace();

                          }

      }

       

       

      standalone-full.xml has:

      <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
              <resource-adapters>
                  <resource-adapter>
                      <archive>
                          wmq.jmsra.rar
                      </archive>
                  </resource-adapter>
              </resource-adapters>
          </subsystem>    

      and

      <mdb>
             <resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
             <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
      </mdb>

       

       

       

      I updated to latest Websphere Client: 7.1.0.1   (rar meta-inf has this version #)

       

       

      The only anomalies I see on startup, which I am not sure are important:

      ==============================================

      01:48:18,626 WARN  [org.jboss.ejb3] (MSC service thread 1-3) JBAS014105: ActivationConfigProperty messagingType will be ignored since it is not allowed by resource adapter: wmq.jmsra

       

      and also:

       

      01:47:06,953 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "wmq.jmsra.rar"

      01:47:07,568 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry ldap.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar"  does not point to a valid jar for a Class-Path reference.

      01:47:07,568 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jndi.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar"  does not point to a valid jar for a Class-Path reference.

      01:47:07,569 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry fscontext.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar"  does not point to a valid jar for a Class-Path reference.

      01:47:07,569 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry providerutil.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar"  does not point to a valid jar for a Class-Path reference.

      01:47:07,570 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jms.jar in "/content/wmq.jmsra.rar/com.ibm.msg.client.jms.jar"  does not point to a valid jar for a Class-Path reference.

       

       

       

      I see several posts saying that it is working, but all seem to be from AS 7.1.0. not 7.1.1.Final (?)

        • 1. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
          Justin Bertram Master

          This may be a bug in the WSMQ JCA RA.  Google for "JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously" and you should see a few entries from IBM on this.

          • 2. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
            holgum Newbie

            Already did that.

             

            The IBM docs from here:   http://www-304.ibm.com/support/docview.wss?uid=swg1IC74662

            suggest that the problem is with JBoss MDB.

             

            Also:

            - tried 2 different versions of wmq.jmsra.rar, including the latest, and have the same problem with both.

            - if there is a bug in wmq.jms.ra, then how has anyone else gotten it working?

            • 3. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
              holgum Newbie

              I thought I would also post my Websphere MQ setup, since I'm not an expert on that:

               

              - Created queue manager with name 'QMA'

              - Created server connection channel 'JBOSS.SVRCONN' with mcauser 'mqm'

              - Created listener on port 1414

              - Created local queue 'QUEUE1' and added some messages to it with MQ explorer

               

              If someone knows of something I missed please let me know.

              • 4. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                holgum Newbie

                Minor update:

                Just as a test, I set up JBoss 6.1 and used the same wmq.jmsra.rar. Works fine under JBoss 6.1, although the config is significantly different.

                Used the instructions from IBM for JBoss 6.1 found here: 

                    http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fjm40210_.htm&resultof=%22%6a%62%6f%73%73%22%20

                 

                Had to modify configs for my setup but it worked.

                 

                So I'm still stumped on 7.1.1. 

                I suspect the error above ('JMS specification does not permit the use of a session for synchronous methods when asynchronous message delivery is running') is something to do with faulty configuration somewhere since my MyMDB is trivial and there's nothing else running on a clean install of JBoss 7.1.1.FInal.

                 

                If anyone has it working, I'd love to see a complete example including: standalone-full.xml, ejb-jar.xml, jboss-xml, and the java code.

                • 5. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                  Justin Bertram Master

                  This is from a colleague, so I don't have first-hand information:

                   

                  • JBoss AS 7.1.1.Final
                  • IBM MQ queue manager 6.0.2.8
                  • IBM MQ JCA RA 7.0.0 patched to 7.0.1
                  • Relevant portion of standalone*.xml:

                   

                          <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
                              <resource-adapters>
                                  <resource-adapter>
                                      <archive>
                                          wmq.jmsra.rar
                                      </archive>
                                      <transaction-support>XATransaction</transaction-support>
                                      <config-property name="traceEnabled">
                                          true
                                      </config-property>
                                      <config-property name="traceLevel">
                                          3
                                      </config-property>
                                      <connection-definitions>
                                          <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="java:jboss/jms/MQCF" enabled="true" use-java-context="true" pool-name="MQCF">
                                              <config-property name="port">
                                                  11415
                                              </config-property>
                                              <config-property name="hostName">
                                                  my.mq.host
                                              </config-property>
                                              <config-property name="channel">
                                                  CHANNEL
                                              </config-property>
                                              <config-property name="transportType">
                                                  CLIENT
                                              </config-property>
                                              <config-property name="queueManager">
                                                  QUEUE_MANAGER
                                              </config-property>
                                              <xa-pool>
                                                  <min-pool-size>1</min-pool-size>
                                                  <max-pool-size>10</max-pool-size>
                                              </xa-pool>
                                          </connection-definition>
                                      </connection-definitions>
                                      <admin-objects>
                                          <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/jms/JBOSS.TEST" enabled="true" use-java-context="true" pool-name="JBOSS.TEST">
                                              <config-property name="baseQueueName">
                                                  JBOSS.TEST
                                              </config-property>
                                              <config-property name="baseQueueManagerName">
                                                  QUEUE_MANAGER
                                              </config-property>
                                          </admin-object>
                                      </admin-objects>
                                  </resource-adapter>
                              </resource-adapters>
                          </subsystem>
                  

                   

                  • MDB:

                   

                  import javax.ejb.*;
                  import javax.jms.Message;
                  import javax.jms.TextMessage;
                  import javax.jms.JMSException;
                  import javax.ejb.MessageDriven;
                  import javax.jms.MessageListener;
                  import javax.ejb.ActivationConfigProperty;
                  import org.jboss.ejb3.annotation.ResourceAdapter;
                  
                  @MessageDriven( name="MQTestClient", activationConfig = {
                              @ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),
                              @ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
                              @ActivationConfigProperty(propertyName = "hostName", propertyValue = "my.mq.host"),
                              @ActivationConfigProperty(propertyName = "port", propertyValue = "11415"),
                              @ActivationConfigProperty(propertyName = "channel", propertyValue = "CHANNEL"),
                              @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QUEUE_MANAGER"),
                              @ActivationConfigProperty(propertyName = "destination", propertyValue = "JBOSS.TEST"),
                              @ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT")
                  })
                  @ResourceAdapter(value = "wmq.jmsra.rar")
                  @TransactionAttribute(TransactionAttributeType.REQUIRED)
                  @TransactionManagement(TransactionManagementType.CONTAINER)
                  public class MQTestClient implements MessageListener {
                            @Override
                            public void onMessage(Message message) {
                            TextMessage textMessage = (TextMessage) message;
                            try {
                                 System.out.println("\n\n\t Message Received by MDB : "+ textMessage.getText());
                            } catch (JMSException e) {
                                 e.printStackTrace();
                            }
                            }
                  }
                  

                   

                  I also believe the mqetclient.jar (i.e. extended transaction client) was added to the wmq.jmsra.rar to enable XA transactions.

                   

                  Like I said before, this is second-hand information so I can't perfonally vouch that it worked, but I'm told that it did.

                  • 6. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                    holgum Newbie

                    Thanks.

                    That matches my setup, except for the fact that I have 'NotSupported' for the transactions since I don't need XA at the moment.

                     

                    BTW, from my reading of the IBM resource adapter docs, the Connection definitions in the standalone-full.xml for the ConnectionFactory and Queue are not relevant for a MDB (I suppose that's obvious from the 'outbound' in the classname).

                     

                    Anyway, still no love.  Just for the heck of it, I tried running JBoss on Mac OS instead of RedHat. Same result.

                    • 7. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                      holgum Newbie

                      Going to have to go back to JBoss 6.1 and give up on 7.1, at least for now.  Fortunately that's an option in this case.

                       

                      At this point, I think the evidence I have would point to the problem being in JBoss 7.1, or at least the combination of JBoss 7.1 and WebSphere MQ Client 7.1.

                       

                      To summarize, this works fine:

                      JBoss 6.1

                      wmq.jmsra.rar 7.1.0.1

                      MDB annotated as per my original post

                       

                      Same MDB and rar do not work under JBoss 7.1.1.Final (or 7.1.0).

                       

                      If anyone has different results please let me know.

                      • 8. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                        jaikiran pai Master

                        I haven't read through the thread completely, but will do sometime later today. But before going  back to 6.1, could you please try this once against the latest nightly build https://community.jboss.org/thread/167590 and see if it works there?

                        1 of 1 people found this helpful
                        • 9. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                          holgum Newbie

                          Bingo!

                           

                          Latest build (jboss-as-7.2.0.Alpha1-SNAPSHOT build #1007) works fine.

                           

                          I can use that for now. Do you know timeframe for first releases of 7.2?

                           

                          Thanks very much for your help.

                          • 10. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                            jaikiran pai Master

                            Manny Holguin wrote:

                             


                            Latest build (jboss-as-7.2.0.Alpha1-SNAPSHOT build #1007) works fine.

                             

                            I can use that for now. Do you know timeframe for first releases of 7.2?

                             

                             

                            I don't know the exact date. But Jason did mention that he's going to start looking into the 7.2 related stuff and I believe he'll update the roadmap on the JIRA accordingly, some time soon. So keep an eye on the AS7 JIRA roadmap.

                            • 11. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                              mail2 pps Newbie

                              Hello, I'm working on migrating application from Websphere to JBoss. I picked jboss-eap-6.2.0 for deployment and Websphere RA(WebMq-7.5.0) to connect WMQ,  it is connecting to both un-secured and secured Websphere Queue if I define all the information. like QMGR, QName, QHostname,QPort etc in ejb-jar.xml(no jboss.xml/jboss-ejb3.xml file. the same information had already defined in standalone-full.xml with JNDI name so I'm trying use QCF JNDI name with "connectionFactoryJndiName" activation-config-property-name in ejb-jar.xml file, but jboss is not recognizing qcf jndi name. In the server startup log, getting below warning message. As it's not recognizing qcf JNDI name, it tries to connect localhost(1414) by default. I really don't wanna define the queue details in both ejb-jar.xml and standalone-full.xml. has anyone encountered the same issue? and found the solution? your help is much appreciated. Thanks for you time in Advance.

                               

                              18:04:07,630 WARN  [org.jboss.as.ejb3] ActivationConfigProperty connectionFactoryJndiName/messagingType will be ignored since it is not allowed by resource adapter: wmq.jmsra.rar

                               

                              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)

                                  ... 22 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  occurred. [1=java.net.ConnectException[Connection refused: connect],3=localhost]],3=localhost(1414),5=RemoteTCPConnection.connnectUsingLocalAddress]

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

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

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

                                  ... 21 more

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

                               

                              ejb-jar.xml

                              ----------------

                              ....

                              <message-driven>

                                  <display-name>ProcessService</display-name>

                                  <ejb-name>ProcessService</ejb-name>

                                  <ejb-class>com.chase.chf.emi.common.framework.mdb.ProcessServiceBean</ejb-class>

                                  <messaging-type>javax.jms.MessageListener</messaging-type>

                                  <transaction-type>Container</transaction-type>

                                  <message-destination-type>javax.jms.Queue</message-destination-type>

                                  <activation-config>

                                      <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>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>java:jboss/jms/QueueJNDI</activation-config-property-value>

                                      </activation-config-property>

                                      <activation-config-property>

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

                                          <activation-config-property-value>Auto-acknowledge</activation-config-property-value>

                                      </activation-config-property>

                                      <activation-config-property> 

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

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

                                      </activation-config-property> 

                                      <activation-config-property>

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

                                          <activation-config-property-value>java:jboss/jms/QCFJNDI</activation-config-property-value>

                                      </activation-config-property>    

                              <message-driven>

                              .....

                              • 12. Re: MDB not consuming messages from Websphere MQ in 7.1.1.Final
                                Justin Bertram Master

                                First of all, you shouldn't hijack somebody else's thread with your own question.  Rather you should create a new thread.

                                 

                                Second, as far as I know the WebSphere MQ JCA RA doesn't support the functionality you're looking for.  The error message is clear - "ActivationConfigProperty connectionFactoryJndiName/messagingType will be ignored since it is not allowed by resource adapter: wmq.jmsra.rar".  In other words, the WebSphere MQ JCA RA (i.e. wmq.jmsra.rar) doesn't support the activation configuration property "connectionFactoryJndiName".  The application server has no control over this. 

                                 

                                I've seen lots of users who don't want to repeat the same configuration details for both inflow and outflow, but that doesn't appear possible.  I recommend you work with IBM to implement the functionality you're looking for.