2
votes

I'm trying to use mo74 library but I always get exception "System.TypeInitializationException,WebSphereMQ.".

Library is installed (I can get help by WMQ commands).

The link from where I downloaded it - http://www-01.ibm.com/support/docview.wss?uid=swg24017698 Configuration:

    Windows Server 2008R2
    PSVersion 2.0
    Broker Version 7.0.0.5

Also tried on Windows 7, PS 2.0, Broker 7.0.0.5, Windows Server 2012, PS 4.0, Broker 7.0.0.0 with same result.

After install I tried to add WebSphereMQ.dll to GAC

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

But it didn't help.

Full exception:

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

Thanks for answers in advance!

1
Shot in the dark but you don't mention the architecture of the running PowerShell instance. The installation appears to be x86 architecture. Are you running a 32-bit shell?Matt
Matt, it is 64-bit operation system, for execute script I used Windows PowerShell (x86)Andrey Lolcost
You didn't mention having any MQ components installed. What's the output when you run dspmqver -a?T.Rob
Can you please post the complete exception stack?Shashi
Shashi, added to the question text in main theme - "Full exception".Andrey Lolcost

1 Answers

1
votes

The problem have been solved in the new version of the driver. Link - http://www-01.ibm.com/support/docview.wss?uid=swg24017698