3
votes

We are trying to make our project which currently runs on WebSphere also work on Liberty.

In trying to get an MDB to work I get the following error: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME')

The relevant portion of the server.xml:

<jmsQueue id="jms/incomingRequestQueue" jndiName="jms/incomingRequestQueue">
    <properties.mqJms baseQueueName="QUEUEIN" />
</jmsQueue>

<jmsActivationSpec id="application-ear/application-war/InboundMDB"
    authDataRef="mqJms.auth">
    <properties.mqJms destinationRef="jms/incomingRequestQueue" destinationType="javax.jms.Queue"
        transportType="CLIENT"
        hostName="${mqconnection.hostName}" port="${mqconnection.port}"
        channel="${mqconnection.channel}"
        messageCompression="NONE"
        rescanInterval="5000"
        sslCipherSuite="${mqconnection.sslCipherSuite}"
        brokerControlQueue="${mqconnection.brokerControlQueue}" brokerSubQueue="${mqconnection.brokerSubQueue}"
        brokerCCSubQueue="${mqconnection.brokerCCSubQueue}" brokerCCDurSubQueue="${mqconnection.brokerCCDurSubQueue}"/>
</jmsActivationSpec>

The values in the Liberty configuration were taken from WebSphere.

My question is if the reason for this error can only be that the queue name is incorrect, or if something could be missing from the configuration.

Update: the solution turned out to be to change destinationRef to destination and add useJNDI="true"

2

2 Answers

1
votes

If you look at the logs on MQ and it appears to be trying to open an MQ object called jms/incomingRequestQueue, try replacing destinationRef with destinationLookup. Some methods of specifying the destination for an activation spec just pass the value straight to MQ instead of doing a lookup in the JNDI context for an admin object and fetching the right property.

See the notes in this table about the relationship between destination and destinationLookup. DestinationRef is a property that Liberty adds and I'm not sure how it all relates to the properties the resource adapter actually exposes but may be making this switch unnecessary. It all depends on what string you're trying to look up as a queue on the queue manager.

Additionally, for those who might have this issue and are using the destination property (likely in conjuntion with JMS 1.1/Java EE 6), where destinationLookup doesn't exist, you can specify useJNDI="true" as a property on the activation spec to resolve this, see the table linked above.

1
votes

I was doing a migration to Open Liberty some time ago and also had some troubles. I managed to make it work, but cannot guarantee this will work for you as your case might be a bit different.

First, check carefully if baseQueueName="QUEUEIN" is correct (perhaps it is case-sensitive and does not match or something e.g. some prefix is missing).

Maybe setting a correct queueManager will help.

Here is my setup that works and it is almost the same as yours.

    <resourceAdapter id="mqJMS" location="..../wmq.jmsra-9.1.4.0.rar"/>

    <authData id="mqAlias" password="${env.MQ_PWD}" user="${env.MQ_USER}"/>


    <jmsActivationSpec authDataRef="mqAlias" id="app-name/MyMessageBean">
        <properties.mqJms destinationRef="jms/MyQ"
                           destinationType="javax.jms.Queue"
                           sslCipherSuite="${env.MQ_SSL_CIPHER_SUITE}"
                           channel="${env.MQ_CHANNEL}"
                           queueManager="${env.MQ_QUEUE_MANAGER}"
                           hostName="${env.MQ_HOST}" port="${env.MQ_PORT}"
                           transportType="CLIENT" />
    </jmsActivationSpec>


    <jmsQueue id="jms/MyQ" jndiName="jms/MyQ">
        <properties.mqJms baseQueueName="${env.MY_QUEUE}"
                           baseQueueManagerName="${env.MQ_QUEUE_MANAGER}" />
    </jmsQueue>


</server>

In general, the reason code 2085 means that the referenced queue could not be found on the Queue Manager.

There is this IBM Article that can be useful, especially Resolving The Problem section where you can see a short description of what they recommend to do in this case.