2015-05-25 18 views
2

我試圖使用mo74庫,但我總是得到異常「System.TypeInitializationException,WebSphereMQ。」。獲取異常「System.TypeInitializationException,WebSphereMQ。<Command Name>」 - mo74_PowerShell

圖書館已安裝(我可以通過WMQ命令獲得幫助)。

從那裏我下載的鏈接 - http://www-01.ibm.com/support/docview.wss?uid=swg24017698 配置:

Windows Server 2008R2 
    PSVersion 2.0 
    Broker Version 7.0.0.5 

也試過在Windows 7上,PS 2.0,經紀人7.0.0.5,Windows Server 2012中,PS 4.0,經紀人7.0.0.0具有相同結果。

安裝後我試圖WebSphereMQ.dll添加到GAC

[Reflection.Assembly]::LoadWithPartialName("System.EnterpriseServices") | Out-Null 
[System.EnterpriseServices.Internal.Publish] $publish = new-object System.EnterpriseServices.Internal.Publish 
$publish.GacInstall(<<FullFilePathToTheDll>>) 

但它並沒有幫助。

完全例外:

PS C:\Windows\system32> Get-WMQQueue SYSTEM.DEFAULT.LOCAL.QUEUE 
Get-WMQQueue : The type initializer for 'IBM.WMQ.Nmqi.BindingsNmqiMQ' threw an exception. 
At line:1 char:13 
+ Get-WMQQueue <<<< SYSTEM.DEFAULT.LOCAL.QUEUE 
+ CategoryInfo   : NotSpecified: (:) [Get-WMQQueue], TypeInitializationException 
+ FullyQualifiedErrorId : System.TypeInitializationException,WebSphereMQ.GetWMQQueue 

感謝答案提前!

+0

在黑暗中拍攝,但您沒有提及正在運行的PowerShell實例的體系結構。該安裝似乎是x86架構。你運行的是32位的shell嗎? – Matt

+0

Matt,它是64位操作系統,用於執行腳本我使用Windows PowerShell(x86) –

+0

您沒有提到安裝了任何MQ組件。運行'dspmqver -a'時輸出是什麼? –

回答

相關問題