Search code examples
javaibm-mqwebsphere-libertyopen-liberty

Why does my liberty configuration result in an unknown object name error?


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"


Solution

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