BizTalk MQSeries Adapter starts to fail after upgrading IBM MQ to version 8

I’ve recently came across  a couple of similar cases due to the same reason so I decided to create this post

Context

You have BizTalk 2013 with HIS 2013 CU3, or higher version. Note: This is the first BizTalk Version supporting MQ v8.

You are using BizTalk MQSeries Adapter, and hence having Microsoft BizTalk MQAgent installed in IBM MQ Servers.

Symptom

After upgrading IBM MQ to v8.0, you start observing below errors in MQ Server related to Microsoft MQAgent:

  • Log Name:      Application
    Event ID:      4786
    Level:         Error
    Keywords:      Classic
    Description:
    The system has called a custom component and that component has failed and generated an exception. This indicates a problem with the custom component. Notify the developer of this component that a failure has occurred and provide them with the information below.
    Server Application ID: {C691D827-19A0-42E2-B5E8-2892401481F5}
    Server Application Instance ID:
    {2C537DA2-535B-424F-AF91-B75498C6F40B}
    Server Application Name: MQSAgent2
    The serious nature of this error has caused the process to terminate.
    Exception: C0000005
    Address: 0x742C83EB

and MQSeries Receive Location stop working, showing below error message:

  • The adapter "MQSeries" raised an error message. Details "Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.BizTalk.Adapter.MQS.Agent.IMQSAgent'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EB62BF71-65F5-4C0B-AEC2-8CFE02754F6E}' failed due to the following error: The authentication service is unknown. (Exception from HRESULT: 0x800706D3).".

Possible Cause

From Version 8.0.0, Fix Pack 2, IBM MQ provides C++ client libraries that are built with the Microsoft Visual Studio 2005 C++ compiler. Applications requiring the IBM MQ C++ libraries that are built with Microsoft Visual Studio 2005, must prefix their PATH environment variable with bin\vs2005 or bin64\vs2005, depending on the type of application, as shown in the following examples.

  • For 32-bit applications: SET PATH=<install folder>\bin\vs2005
  • For 64-bit applications: SET PATH=<install folder>\bin64\vs2005

See IBM Article for further details: https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q030490_.htm

Since BizTalk MQSAgent is a 32-bit application, Environment Variable Path on MQ server nodes should include “<MQ install folder>\bin\vs2005;” in the beginning of the path before any other IBM paths, and by default it doesn't.

 

Resolution

Change Environment Variable Path on IBM MQ Server to include “<install folder>\bin\vs2005;” in the beginning of the path before any other IBM one.

SET PATH=<MQ install folder>\bin\vs2005;%PATH%

 

Hope it helps!!