2 Replies Latest reply on Feb 15, 2016 8:45 AM by efi-capahjo

    IBM MQ Resource adaptor usage Issue with JBoss 6.3

    chetansoftware

      Hi All,

       

      I am trying to use IBM MQ adaptor in JBoss first time (even using JBoss for the first time). We are migrating our application from Websphere 7 to JBoss 6.3. And for that i need configure same MQ's which we used to use on IBM Websphere. Hence I have started configuring IBM Resource adaptor. Below is the standalone.xml file configuration.

      Below config works fine however I am not able to get QueueConnectionFactory with code (QueueConnectionFactory) context.lookup("java:/comp/env/serviceQCF") as it throws class cast exception (com.ibm.mq.connector.outbound.ConnectionFactoryImpl cannot be cast to javax.jms.QueueConnectionFactory).

      And when I use <connection-definition class-name="javax.jms.QueueConnectionFactory" jndi-name="java:/comp/env/serviceQCF" enabled="true" pool-name="ConnectionClass">, JBoss is throwing exception javax.naming.NameNotFoundException: comp/env/serviceQCF -- service jboss.naming.context.java.comp.env.serviceQCF

       

      I have tried using ConnectionFactory however same result (Name not found exception)

       

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

                  <resource-adapters>

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

                          <archive>

                              wmq.jmsra.rar

                          </archive>

                          <transaction-support>LocalTransaction</transaction-support>

                          <connection-definitions>

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

                                  <config-property name="port">

                                      1414

                                  </config-property>

                                  <config-property name="channel">

                                      MQ.CLT.STH.CHL

                                  </config-property>

                                  <config-property name="hostName">

                                      127.0.0.127

                                  </config-property>

                                  <config-property name="transportType">

                                      MQ.CLIENT

                                  </config-property>

                                  <config-property name="queueManager">

                                      MQSYKHT0

                                  </config-property>

                                  <security>

                                      <application/>

                                  </security>

                                  <validation>

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

                                  </validation>

                              </connection-definition>

                          </connection-definitions>

       

      Do I need to configure something Else? Do i need to add/modify any classpath? If yes where and how?

        • 1. Re: IBM MQ Resource adaptor usage Issue with JBoss 6.3
          chetansoftware

          Looks like I have resolved this problem.

          I just put below line of code after analyzing rs.xml.

           

          ConnectionFactory factory =(ConnectionFactory) context.lookup(""java:/comp/env/serviceQCF");

           

          However I am still surprised, how could this resolve that original problem as below line is still there and its working fine now. (I am getting QueueConnectionFactory).

          queueManager = (QueueConnectionFactory) context.lookup(""java:/comp/env/serviceQCF");

           

          Now I am able to send msg over MQ however getting nothing in reply. Looking in to it now.

          • 2. Re: IBM MQ Resource adaptor usage Issue with JBoss 6.3
            efi-capahjo

            Hello,

             

            You can use <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="java:jboss..........> instead of ManagedConnectionFactoryImpl.