Ozkan
Ozkan

Reputation: 4170

Buffer is null in ImportMQMDMesageBuffer, causes client application to crash

We are facing a difficult problem, I hope someone can give advice on how we can troubleshoot this.

We encounter following XMSException in our logging:

IBM.XMS.XMSException: CWSMQ0282E: A null value has been used for argument BUFFER = <> NULL within method ImportMQMDMesageBuffer(WmqSession, WmqDestination, MQMD,byte[],int,int). 
The preceding method detected an invalid  null argument. 
If necessary, recode the application to avoid the error condition. 
   at IBM.XMS.Client.WMQ.WmqReceiveMarshal.ImportMQMDMesageBuffer(MQMessageDescriptor mqmd, Byte[] buffer, Int32 dataStart, Int32 dataEnd) 
   at IBM.XMS.Client.WMQ.WmqAsyncConsumerShadow.Consumer(Phconn hconn, MQMessageDescriptor mqmd, MQGetMessageOptions mqgmo, Byte[] pBuffer, MQCBC mqcbc) 
   at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.NmqiConsumerMethodUM(Int32 hconn, IntPtr structMqmd, IntPtr structMqgmo, IntPtr buffer, IntPtr structMqcbc)

After this XMSException, the Windows Service crashes. The difficult part is that we can't reproduce this behavior on our dev environment. We are still troubleshooting, we couldn't find what's the root cause of this issue.

Below you can find information on how we make connection:

Used version: IBM.XMS 8.0.0.5

A connection is created this way:

XMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ); 
IConnectionFactory cf = factory.CreateConnectionFactory(); 
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED); 
cf.SetStringProperty(XMSC.WMQ_HOST_NAME, hostname); 
cf.SetStringProperty(XMSC.WMQ_PORT, port); 
cf.SetStringProperty(XMSC.WMQ_CHANNEL, channelname); 
cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, qmname); 
IConnection connection = cf.CreateConnection(); 

Session is created this way:

ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);

Destination is created this way:

destination = session.CreateQueue("queuename"); 
destination.SetIntProperty(XMSC.WMQ_MESSAGE_BODY, XMSC.WMQ_MESSAGE_BODY_MQ); 
destination.SetBooleanProperty(XMSC.WMQ_MQMD_WRITE_ENABLED, true); 
destination.SetBooleanProperty(XMSC.WMQ_MQMD_READ_ENABLED, true);

Listener is created this way:

IMessageConsumer consumer = session.CreateConsumer(destination); 
consumer.MessageListener = listenerDelegate;

The same XMSException is also asked here a few years ago. I see they have opened a PMR for this issue, but without any update...

Upvotes: 1

Views: 207

Answers (1)

JoshMc
JoshMc

Reputation: 10672

On March 28th 2019 IBM released an APAR that appears to be an exact match for the issue you reported.

IT28062: While getting an empty message, XMS .Net applications reports CWSMQ0282E and crash.

Unfortunately the APAR is not included in any current releases of MQ (As of March 29th). You will need to either wait for a release to come out which includes this APAR or get your client to open a PMR and ask them for a IFIX for this APAR against the version of MQ you are using.

The APAR is targeted for the following maintenance levels, I also added the target date for each level from IBM MQ planned maintenance release dates.

Version    Maintenance Level   Planned Release Date
v8.0       8.0.0.12            2Q 2019
v9.0 LTS   9.0.0.7             2Q 2019
v9.1 LTS   9.1.0.3             Not noted yet, 9.1.0.2 is targeted for 2Q 2019
v9.1 CD    9.1.3               CD releases historically have been between
                               2 and 6 months apart.
                               9.1.2 was released March 21 2019.

Upvotes: 1

Related Questions