Author |
Message
|
Anwar123 |
Posted: Thu Jul 19, 2012 10:11 pm Post subject: The type initializer for 'IBM.WMQ.MQQueueManager' threw an e |
|
|
Newbie
Joined: 19 Jul 2012 Posts: 3
|
Hi
I am builbing a .Net windows services on Windows 2003. I am using amqmdnet.dll for Creating Object of MQQueuemanager. My code is
Code: |
public CitigatewayMQConnection(string queueManagerName, Hashtable properties)
: base()
{
try
{
m_qmgr = new MQQueueManager(queueManagerName, properties);
m_queueTable = new Dictionary<string, CitigatewayMQQueue>();
}
catch (MQException ex)
{
CreateLog("ex.CompCode=" + ex.CompCode + " ex.ReasonCode=" + ex.ReasonCode + " ex.Data=" + ex.Data + " ex.HelpLink=" + ex.HelpLink + " ex.InnerException=" + ex.InnerException + " ex.Reason" + ex.Reason, EventLogEntryType.Error);
}
catch (Exception ex)
{
CreateLog("ConnectMQManager::Source::" + ex.Source + "::Message::" + ex.Message, EventLogEntryType.Error);
}
} |
Every time I am getting the following exception
Code: |
ConnectMQManager::Source::amqmdnet::Message::The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception. |
Following Version of MQ
Name: WebSphere MQ
Version: 7.0.1.2
CMVC level: p701-102-100504
BuildType: IKAP - (Production)
Platform: WebSphere MQ for Windows
Mode: 32-bit
O/S: Windows Server 2003, Build 3790: SP2
AMQ8351: WebSphere MQ Java environment has not been configured correctly.
AMQ8351: WebSphere MQ Java environment has not been configured correctly.
AMQ8351: WebSphere MQ Java environment has not been configured correctly.
Name: IBM WebSphere MQ custom channel for Windows Communication Foundatio
n
Version: 7.0.1.0
CMVC Level: wn701-L090925
Build Type: Production
Name: IBM Message Service Client for .NET (XMS .NET)
Version: 2.0.0.2
CMVC Level: nn200-L100429
Build Type: Production
Kindly help, Thanks in advance |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 20, 2012 4:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
It seems clear that there's a configuration error.
As you've not bothered to post any details on how you've configured the environment or indeed what property values you're using to create the queue manager object it's impossible to say what the problem might be. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Anwar123 |
Posted: Mon Jul 23, 2012 7:17 pm Post subject: |
|
|
Newbie
Joined: 19 Jul 2012 Posts: 3
|
Yes, After changing the environment variable, It sarted working, now I have one more issue, whenever I begin the transaction, it throw an exception, MQRC_ENVIRONMENT_ERROR.MQRC_ENVIRONMENT_ERROR
BeginTransaction Exception CompletionCode:2 ReasonCode=2012 |MQRC_ENVIRONMENT_ERROR |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jul 23, 2012 8:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
you want to upgrade. V 7.0.1.2 won't cut it.
Try V 7.0.1.8
Also you might have been using the wrong type of connection...
Make sure you use an unmanaged connection...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Anwar123 |
Posted: Tue Jul 24, 2012 4:11 am Post subject: |
|
|
Newbie
Joined: 19 Jul 2012 Posts: 3
|
How Can I determine the type of connection I am just using amqmdnet.dll
and creating the MQ object.
MQMangerConProp.Add(MQC.HOST_NAME_PROPERTY, MQManagerProp.MQHostName);
MQMangerConProp.Add(MQC.CHANNEL_PROPERTY, MQManagerProp.MQChannelName);
MQMangerConProp.Add(MQC.PORT_PROPERTY, MQManagerProp.MQPortNumber);
}
CGMQConnect = new CitigatewayMQConnection(MQManagerProp.MQName, MQMangerConProp);
And please can you explain what do you mean by unmanaged connection...
 |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 24, 2012 4:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Anwar123 wrote: |
How Can I determine the type of connection I am just using amqmdnet.dll
and creating the MQ object. |
Which means the dll will (in the absense of one being specified by you) determine by inference which connection type to use, by means laid out in the documentation.
Anwar123 wrote: |
And please can you explain what do you mean by unmanaged connection... |
The WMQ .NET supports 3 different connection types. Perhaps you should research them further before trying to use the interface by randomly grabbing methods from the dll? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jul 24, 2012 4:35 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
IMS, there is an IBM WMQ manual with .net in the title. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|