Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我正忙着编写一个C#IBM MQ客户端应用程序,并不断得到;例外情况:';IBM.WMQ.Nmqi.UnmanagedNmqiMQ';抛出异常。”;_C#_.net_Ibm Mq_Messaging - Fatal编程技术网

我正忙着编写一个C#IBM MQ客户端应用程序,并不断得到;例外情况:';IBM.WMQ.Nmqi.UnmanagedNmqiMQ';抛出异常。”;

我正忙着编写一个C#IBM MQ客户端应用程序,并不断得到;例外情况:';IBM.WMQ.Nmqi.UnmanagedNmqiMQ';抛出异常。”;,c#,.net,ibm-mq,messaging,C#,.net,Ibm Mq,Messaging,我已成功运行MQ客户端,并且使用它可以获得消息 我们已经设置了必要的环境变量: MQCHLLIB和MQCHLTAB以及MQSSLKEYR .TAB文件位于正确的文件夹中。 但是,当我执行以下代码时: private static bool ConnectMq() { try { queueManager = new MQQueueManager("ECG_MBTST_QM", Init(false)); qu

我已成功运行MQ客户端,并且使用它可以获得消息

我们已经设置了必要的环境变量: MQCHLLIB和MQCHLTAB以及MQSSLKEYR

.TAB文件位于正确的文件夹中。 但是,当我执行以下代码时:

private static bool ConnectMq()
    {
        try
        {
            queueManager = new MQQueueManager("ECG_MBTST_QM", Init(false));
            queueManager.Connect();
            if (queueManager.IsConnected)
            {
                Console.WriteLine("Connected...");
            }
            return true;
        }
        catch (MQException exp)
        {
            Console.WriteLine("Exception Message: " + exp.Message); 
        }
        catch (Exception exp)
        {
            Console.WriteLine("Exception: " + exp.Message);
        }
        return false;
    }
    private static Hashtable Init()
    {
        Hashtable properties;
        properties = new Hashtable
            {
                {MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT}
            };

        return properties;
    }
我得到了如上所述的错误消息。 我别无选择,只能使用CCDT文件,因为这是服务器主机指定的。 我相信服务器是v7,我引用的是v8 WMQ库。 理论上,这应该是可行的

我也尝试过使用标准属性集(出于安全目的,值已被更改):

但是当我使用上述属性时,我得到一个2538错误-主机不可用。 关于如何将CCDT文件和C#一起使用,我缺少什么吗

提前谢谢

编辑-根据JoshMC的要求

这是AMQERR01.LOG文件中的最新条目:

1/18/2017 1:51:05 AM - Process(3272.1) User(andrewhuntley) Program( MQ app.exe)
AMQ9202: Remote host '192.168.150.102' not available, retry later.

EXPLANATION:
The attempt to allocate a conversation using TCP/IP to host '192.168.150.102'
for channel  (Exception) was not successful. However the error may be a
transitory one and it may be possible to successfully allocate a TCP/IP
conversation later. 

 In some cases the remote host cannot be determined and so is shown as '????'.
ACTION:
Try the connection again later. If the failure persists, record the error
values and contact your systems administrator. The return code from TCP/IP is 0
(X'0'). The reason for the failure may be that this host cannot reach the
destination host. It may also be possible that the listening program at host
'192.168.150.102' was not running.  If this is the case, perform the relevant
operations to start the TCP/IP listening program, and try again.
----- MQTCPConnection.cs : 357 ------------------------------------------------
请注意,服务器已启动并运行,可以访问,因为我可以使用已安装的IBM客户端连接到它。

使用IBM MQ 8.0.0.5 MQ库

我从IBM找到了这个APAR,它似乎与您收到的确切错误消息相匹配


这应该在下一个fixpack 8.0.0.6中修复,该版本应在2017年3月底发布。如果您有IBM支持合同,您也可以打开PMR并请求他们向您提供受影响dll的副本,该dll包含针对8.0.0.5的此APAR的修复程序。

最近才看到这个问题

位于的MQ.NET客户端不是IBM提供的。它明确提到“非官方的”

它只能在.NET托管模式下使用,不能在绑定或.NET非托管客户端模式下使用,因为它没有其他依赖库


IBM.WMQ.Nmqi.UnmanagedNmqiMQ
异常是因为MQ C客户端库不存在。如果要使用
MQC.TRANSPORT\u MQSERIES\u Client
选项,可以使用
MQC.TRANSPORT\u MQSERIES\u MANAGED
属性的
值来解决异常,或者“安装”MQ可再发行客户端,查看IBM MQ v8安装目录下的
errors
目录中是否有任何错误,如果是这样,您看到的错误与您的客户使用CCDT接收到的错误时间相对应。请使用这些详细信息更新问题。错误目录中没有错误,因为我正在编写的客户端是独立的。v7.5安装的MQ客户端可以100%正常工作。但是,我已经按照您的要求编辑了这个问题,并在我的客户端位置提供了错误文件中的日志。您安装了哪个特定的MQ v8独立客户端(例如:8.0.0.4)?如我之前的评论中所述,我已经安装了v7.5。NETNuget包没有V7.x版本,只有8.Ok,所以这似乎不是一个.Net问题,也不是我创建的问题。这是IBM MQ.Net库的一个问题。是指向IBM站点上列出的问题的链接。似乎2017年第一季度将提供一个修复程序:(是的,我找到了相同的信息。不过我会将此标记为答案。感谢调查。@Vaelen此修复程序可能已经存在于可再发行客户端的v9.0.0.0 LTS和v9.0.1.0 CD版本中。这是基于APAR描述的,没有提到v9,9.0.0.0之后发布的9.0.1.0 CD修复程序列表也没有列出这个APAR。
1/18/2017 1:51:05 AM - Process(3272.1) User(andrewhuntley) Program( MQ app.exe)
AMQ9202: Remote host '192.168.150.102' not available, retry later.

EXPLANATION:
The attempt to allocate a conversation using TCP/IP to host '192.168.150.102'
for channel  (Exception) was not successful. However the error may be a
transitory one and it may be possible to successfully allocate a TCP/IP
conversation later. 

 In some cases the remote host cannot be determined and so is shown as '????'.
ACTION:
Try the connection again later. If the failure persists, record the error
values and contact your systems administrator. The return code from TCP/IP is 0
(X'0'). The reason for the failure may be that this host cannot reach the
destination host. It may also be possible that the listening program at host
'192.168.150.102' was not running.  If this is the case, perform the relevant
operations to start the TCP/IP listening program, and try again.
----- MQTCPConnection.cs : 357 ------------------------------------------------