当与IBM MQ 7.1客户端连接时,存在32位Windows操作系统(Windows XP)面临的问题。IBM 32位操作系统问题(无法连接)
我使用7.1.0.0 amqmdnet.dll(来自IBM \ websphere的\ bin文件夹中引用)
<Reference Include="amqmdnet, Version=7.1.0.0, Culture=neutral, PublicKeyToken=da2dc1d9abf9ed97, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..IBM\WebSphereMQ\7.1.0.0\amqmdnet.dll</HintPath>
</Reference>
(从IBM link下载)
,建设使用MQ.NET类我的.net应用程序但是部署后,如果目标机器已经安装7.1.0.0 MQ客户端,应用程序抛出
System.DllNotFoundException:无法加载DLL“C:\ PROGRAM 文件\我BM \ WebSphere MQ \ bin \ mqz.dll':找不到指定的模块 。 (异常来自HRESULT:0x8007007E)
at NativeUnmanagedType.zstSPI(Int32 hConn, Int32 verbId, Int32 hObj, Byte[] pInOut, Byte[] pIn, Byte[] pOut, Int32& compCode, Int32& reason)
at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.SPIQuerySPI(Hconn hConn, Int32 verbId, Int32& maxInOutVersion, Int32& maxInVersion, Int32& maxOutVersion, Int32& flags, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.MQCONNX(String pQMgrName, MQCNO& pConnectOpts, Hconn parentHconn, Phconn phconn, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.MQCONNX(String pQMgrName, MQConnectOptions pConnectOpts, Phconn phconn, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)
at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
我的代码是
// mq properties
properties = new Hashtable();
properties.Add(MQC.CONNECTION_NAME_PROPERTY, "Connection Name");
properties.Add(MQC.TRANSPORT_PROPERTY, "Transport Type");
properties.Add(MQC.CHANNEL_PROPERTY, "Channel Name");
properties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_HANDLE_SHARE_BLOCK);
//To read the messages
mqGetMsgOpts = new MQGetMessageOptions();
if (mqQueue != null)
{
//Get options for the messsage
mqGetMsgOpts.Options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_WAIT | MQC.MQOO_INQUIRE;
mqGetMsgOpts.MatchOptions = MQC.MQMO_NONE;
mqGetMsgOpts.WaitInterval = 5000; // 5 seconds limit for waiting
}
if (mqMsg.MessageLength > 0 && mqMsg.DataLength > 0)
{
messageData = mqMsg.ReadString(mqMsg.MessageLength);
}
还有就是队列管理器后browse_next调用commit(所以浏览下一个讯息话题)。
//To put the message
if(mqQueue==null)
mqQueue = mqQMgr.AccessQueue("Queue Name",
MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE);
mqMsg.WriteString(message);
我该如何解决该错误,任何想法?相同的一段代码可以很好地运行Windows 64位操作系统。我没有在64位操作系统的websphere MQ客户端安装文件夹中的bin文件夹中存在mqz.dll,它可以工作,但是它在iin 32位操作系统中失败。
任何输入可能有帮助吗? – Sharpeye500 2013-04-24 06:41:23