IBM Support

System.NullReferenceException is received by a .NET application after IBM MQ Fix Pack is installed

Troubleshooting


Problem

After an IBM MQ Server Fix Pack update, a .NET application fails to connect to a queue manager with the following exception:

System.TypeInitializationException: The type initializer for 'IBM.WMQ.Nmqi.BindingsNmqiMQ' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
  at IBM.WMQ.Nmqi.NativeManager.InitializeNativeApis(String mode)
  at IBM.WMQ.Nmqi.BindingsNmqiMQ..cctor()
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
  at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
  at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
  at IBM.WMQ.Nmqi.NmqiEnvironment.GetInstance(String name)
  at IBM.WMQ.Nmqi.NmqiEnvironment.GetMQI(Int32 id)
  at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)
  at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
  at MQ_WebService.MQ_WebService.SendToQueue(String messageString, String QueueName, String QueueMgrName)

Document Location

Worldwide


[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"ARM Category":[{"code":"a8m0z00000008PAAAY","label":"DOTNET-\u003E.NET Classes"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

To view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use the link to actual document below to access the full document. You will be asked to log on if you are not already logged in. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Historical Number

TS014204999

Document Information

More support for:
IBM MQ

Component:
DOTNET->.NET Classes

Software version:
All Versions

Document number:
7071660

Modified date:
28 April 2025

UID

ibm17071660

Manage My Notification Subscriptions