Author |
Message
|
CT Developer |
Posted: Thu Jan 25, 2007 5:57 pm Post subject: C# .NET "Object reference not set to an instance of an |
|
|
Novice
Joined: 06 Nov 2006 Posts: 17
|
I have written C# code to manage sending and receiving messages via the IBM WebSphere Client (version 5.3). My code is invoked from ASP.NET Web Pages (in the Code Behind pages). I get the following message after three or four successful communications with the Message Queue:
"Object reference not set to an instance of an object."
Any ideas on what could make this happen?
I have read as much MQAPI literature as I can, but there seems to be very little on .NET programming for the MQ API.
Appreciate any thoughts on this.
Chuck |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 25, 2007 6:28 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's a whole Using .Net manual.
It sounds like your queue handle might be going out of scope in the thread or something. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
CT Developer |
Posted: Fri Jan 26, 2007 7:30 am Post subject: Multiple instances of my MQ INTERFACE OBJECT. |
|
|
Novice
Joined: 06 Nov 2006 Posts: 17
|
I am getting the "crash" when I call my function with a new copy of my MQAPI Object. The MQAPI creates a new instance of the QueueManager object. Why would this be a problem?
My MQAPI class contains methods to send and receive messages to the MQ Broker similar to the methods shown in the C# sample code.
I am using C# in Visual Studion 2003.
I hope you can help me.
Regards,
Chuck |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 26, 2007 7:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay.
Maybe you aren't checking the result of creating a new QueueManager object - or are not handling exceptions properly.
Maybe you're running into issues with an older version of the .NET classes. You should upgrade your MQ client install to either the most recent fixpack of v5.3 or the most recent fixpack of v6, whichever you're more comfortable with. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
CT Developer |
Posted: Fri Jan 26, 2007 9:03 am Post subject: |
|
|
Novice
Joined: 06 Nov 2006 Posts: 17
|
I am using MQ Client v5.3 and:
amqmdnet.dll 136KB 10/30/2003 6:39 PM |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 26, 2007 9:11 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
there are many sub-versions of v5.3, one for each FixPack/"Corrective Service Diskette" that was issued.
You should be running at FixPack 12 of v5.3. Or version 6.0.2.0.
You can upgrade the client separately from the server. The only time you'll run into issues in certain specific cases (Fixpacks around 8,9 and 10 of v5.3).
I repeat.
You should UPGRADE your client install, if you are not on FP 12 of v5.3 or at 6.0.2.0 of v6. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
CT Developer |
Posted: Fri Jan 26, 2007 10:50 am Post subject: |
|
|
Novice
Joined: 06 Nov 2006 Posts: 17
|
Thank you for the Fixpack information.
I will put in a request to have the client upgraded to Fixpack 12 for v5.3.
How do I tell what fixpack my MQ Client is running?
I do not interact with it directly (as far as I can tell).
Another group has written some middleware software that accepts my messages and returns replys to me. This middleware communicates with a mainframe computer.
Second question:
I am using the MQQueueManager Constructor with parameters
queueManagerName, channel, and connName. I seem to have a string variable for transpoerType that is set to "TCP" which is never used.
Should the transport Type be set somewhere in my C# .NET code?
I really appreciate your help  |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 26, 2007 10:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No, transport type is optional. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
CT Developer |
Posted: Tue Jan 30, 2007 8:37 am Post subject: C# .NET - An unhandled exception of type 'System.Entry... |
|
|
Novice
Joined: 06 Nov 2006 Posts: 17
|
I got Fixpack #13 installed on my test server running Windows 2003.
I removed and re-added my reference to amqmdnet in Visual Studio 2003 Solution Explorer for my windows test application.
I rebuilt my application DLL and Windows app.
When I run the application in debug mode I get the following error when attempting to instantiate a new MQQueueManager:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in amqmdnet.dll
Additional information: Unable to find an entry point named xcxDetachThread in DLL amqxcs.dll.
I hope somebody has been down this path and can help me resolve it.
Regards,
Chuck |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jan 30, 2007 3:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like you might have a thread sharing violation.
If my memory serves me well, you can have a properties object which you can use to initialize the MQQueueManager class. You can share this property object accross threads but not the qmgr object.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|