0 Replies Latest reply on Oct 16, 2015 1:40 AM by armahdi

    WMQ on Wildfly resource adapter properties

    armahdi

      Hello All,

       

       

      I asked a similar question on ironJacmar group, but it seems that it might be related to something else:

      I configured my wmq.jmsra.rar resource adapter, I followed he examples on the net. I added config-properties

       

      Caused by: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'localhost(1414)'.

      Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.

        at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:479)

        at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)

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

        at com.ibm.msg.client.wmq.internal.WMQXAConnection.<init>(WMQXAConnection.java:75)

        at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:195)

        at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6270)

        at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:107)

        at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:363)

        at com.ibm.mq.jms.MQXAConnectionFactory.createXAConnection(MQXAConnectionFactory.java:142)

        at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:211)

        ... 14 more

      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:2062)

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

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

        ... 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]

        at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:810)

        at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1140)

        at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:724)

        at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:400)

        at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:299)

        at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:164)

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

        ... 23 more

      Caused by: java.net.ConnectException: Connection refused: connect

        at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)

        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)

        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)

        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)

        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)

        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)

        at java.net.Socket.connect(Socket.java:579)

        at java.net.Socket.connect(Socket.java:528)

        at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:795)

        at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$5.run(RemoteTCPConnection.java:789)

        at java.security.AccessController.doPrivileged(Native Method)

        at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:787)

        ... 29 more

       

      My resource adpater configuration:

       <resource-adapter id="wmq.jmsra.rar">
                          <archive>
                              wmq.jmsra.rar
                          </archive>
                          <transaction-support>NoTransaction</transaction-support>
                          <connection-definitions>
                              <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:/contmo/ConnectionFactory" use-java-context="true" pool-name="ConnectionFactory">
        <config-property name="port">1414</config-property>  
                                  <config-property name="hostName">blobhost</config-property>
                                  <config-property name="channel">SYSTEM.AUTO.SVRCONN</config-property>
        <config-property name="transportType">CLIENT</config-property>
        <config-property name="queueManager">devel.queue.manager</config-property>
        <config-property name="username">mqm</config-property>
        <pool>
        <min-pool-size>
        1
        </min-pool-size>
        <max-pool-size>
        10
        </max-pool-size>
                                      <prefill>
                                          false
                                      </prefill>
                                      <use-strict-min>
                                          false
                                      </use-strict-min>
                                  </pool>
                                  <security>
                                      <application/>
                                  </security>
                              </connection-definition>
                          </connection-definitions>
                          <admin-objects>
                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:/contmo/Fromcontmo" use-java-context="true" pool-name="Fromcontmo">
                                  <config-property name="baseQueueManagerName">
                                      devel.queue.manager
                                  </config-property>
                                  <config-property name="baseQueueName">
                                      myApp02MQ.01TC
                                  </config-property>
                              </admin-object>
                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:/contmo/Tocontmo" use-java-context="true" pool-name="Tocontmo">
                                  <config-property name="baseQueueManagerName">
                                      devel.queue.manager
                                  </config-property>
                                  <config-property name="baseQueueName">
                                      Ccontmo_myApp02MQ.LA01FC
                                  </config-property>
                              </admin-object>
                          </admin-objects>
                      </resource-adapter>
                  </resource-adapters>
      

       

      Then I replaced the config properties with SystemProperties as shown in this page Message Driven Beans with Wildfly 8, 9 and Websphere MQ · GitHub

       

       

      It does not pick up the properties that i provide in the standalone-full.xml in wildfly.

      <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:/ctm/ConnectionFactory" use-java-context="true" pool-name="ConnectionFactory">
        <config-property name="port">${websphere.port:1414}</config-property>  
                                  <config-property name="hostName">${websphere.hostName:blobhost}</config-property>
                                  <config-property name="channel">${websphere.channel:SYSTEM.AUTO.SVRCONN}</config-property>
        <config-property name="transportType">${websphere.transportType:CLIENT}</config-property>
        <config-property name="queueManager">devel.queue.manager</config-property>
        <config-property name="username">${websphere.username:mqm}</config-property>
                                  <config-property name="password">${websphere.password:mqm}</config-property>
        <pool>
        <min-pool-size>
        1
        </min-pool-size>
        <max-pool-size>
        10
        </max-pool-size>
          <prefill>
         false
                                      </prefill>
                                      <use-strict-min>
                                          false
                                      </use-strict-min>
                                  </pool>
                                  <security>
                                      <application/>
                                  </security>
                              </connection-definition>
                          </connection-definitions>
      

       

       

      <system-properties>
              <property name="websphere.hostName" value="devel.gbst.net"/>
              <property name="websphere.port" value="1414"/>
              <property name="websphere.channel" value="GBST02.DIR.SVRCONN"/>
              <property name="websphere.transportType" value="CLIENT"/>
              <property name="websphere.queueManager" value="devel.queue.manager"/>
        <property name="websphere.password" value="mqm"/>
        <property name="websphere.username" value="mqm"/>
              <property name="websphere.resource.adapter" value="wmq.jmsra.rar"/>
        </system-properties>
      

      it never picks up my host or blobhost, it is like they are not even there. the adminObjects are loaded properly and the connection definition loads as well so i am thinking the properties should be as well.

       

      if i change this line to have value 2414 then it starts picking up the props but now the port is all wrong.

      <property name="websphere.port" value="1414"/>/

      >