Abhash786
Abhash786

Reputation: 901

Error code: 2195 IBM MQ

I am using below code to connect IBM MQ...

public static void CreateConnectionWithBARXMQ()
        {
            XMSFactoryFactory factoryFactory;
            IConnectionFactory cf = null;

            factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
            cf = factoryFactory.CreateConnectionFactory();
            cf.SetStringProperty(XMSC.WMQ_HOST_NAME, <some-host-name>);
            cf.SetIntProperty(XMSC.WMQ_PORT, 1422);
            cf.SetStringProperty(XMSC.WMQ_CHANNEL, <some-channel>);
            cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
            cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, <some-manager>);
            cf.SetStringProperty(XMSC.WMQ_QUEUE_NAME, <some-queue>);

            cf.SetIntProperty(XMSC.WMQ_QMGR_CCSID, XMSC.CCSID_UTF8);

            IConnection connection = cf.CreateConnection();
        }

This code is working fine with unsecured MQ channel. but when I change channel from unsecured to secured one and and security exit code as mentioned below...

cf.SetStringProperty(XMSC.WMQ_SECURITY_EXIT, @"C:\Program Files\IBM\WebSphere MQ\exits\BCPKIJCExit_70R.dll");

it is throwing very generic error...

CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: CompCode: 2, Reason: 2195
. During execution of the specified method an exception was thrown by another component. See the linked exception for more information.

I checked the linked exception but it has same error message as above.

Can anyone tell me what's wrong here.

Upvotes: 0

Views: 4178

Answers (4)

Chetan
Chetan

Reputation: 1

com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2195'.

The error because of DB password getting expire in next six days. We reset the DB password and issue is resolve.

Upvotes: 0

Oliver S.
Oliver S.

Reputation: 109

As far as I know, you need some certificates to use secured XMS communication. I had the same error (2195), when I tried to establish a secure XMS communication with wrong ssl certificates. As user01928374655647382910019283 said the error is totally unspecific I was just lucky to have the idea recreating the certificates!

The error that occurs on missing ssl certificates is more clear like ".. ssl repository not found ..."

In my client (v MQ 7.5) I had to specify them as follows

My example code looks like

        ...
        // Get an instance of factory.
        factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);

        // Create WMQ Connection Factory.
        cf = factoryFactory.CreateConnectionFactory();

        // Set the properties
        cf.SetStringProperty(XMSC.WMQ_HOST_NAME, CoreMqConfiguration.Hostname);
        cf.SetIntProperty(XMSC.WMQ_PORT, CoreMqConfiguration.Port);
        cf.SetStringProperty(XMSC.WMQ_CHANNEL, CoreMqConfiguration.Channel);
        cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);
        cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, CoreMqConfiguration.QueueManagerName);
        // for secure communication with SSL            
        cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, CoreMqConfiguration.CipherSpec);
        cf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, "<path\to\ssl>\key");

        // Create connection.
        connectionWMQ = cf.CreateConnection();
        ...

while cipher spec in my case is

"TLS_RSA_WITH_AES_256_CBC_SHA"

To create the appopriate key repository I was using the tool

%Program Files (x86)%\IBM\Websphere MQ\bin\strmqikm.exe.

In addition you may have a look here:

I guess it won't resolve your problem at once but I hope it helps to set up a working and secured XMS client

Upvotes: 0

Roger
Roger

Reputation: 7476

You need to answer a bunch of questions:

  • What is 'BCPKIJCExit_70R.dll'?
  • Is it designed for IBM MQ?
  • Is the DLL an MQ client-side security exit?
  • Is it a native DLL or a .NET DLL?

Upvotes: 0

Earth
Earth

Reputation: 3571

The 2195 return code is a high-level exception that is hit when errors are not caught at lower levels in the code. Very often these are generated when some external dependency such as file access or Os resources does not behave as expected and the failure cascades into WMQ.

Upvotes: 1

Related Questions