ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » C# .NET "Object reference not set to an instance of an

Post new topic  Reply to topic
 C# .NET "Object reference not set to an instance of an « View previous topic :: View next topic » 
Author Message
CT Developer
PostPosted: Thu Jan 25, 2007 5:57 pm    Post subject: C# .NET "Object reference not set to an instance of an Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 25, 2007 6:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
CT Developer
PostPosted: Fri Jan 26, 2007 7:30 am    Post subject: Multiple instances of my MQ INTERFACE OBJECT. Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 26, 2007 7:56 am    Post subject: Reply with quote

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
View user's profile Send private message
CT Developer
PostPosted: Fri Jan 26, 2007 9:03 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 26, 2007 9:11 am    Post subject: Reply with quote

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
View user's profile Send private message
CT Developer
PostPosted: Fri Jan 26, 2007 10:50 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 26, 2007 10:54 am    Post subject: Reply with quote

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
View user's profile Send private message
CT Developer
PostPosted: Tue Jan 30, 2007 8:37 am    Post subject: C# .NET - An unhandled exception of type 'System.Entry... Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jan 30, 2007 3:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » C# .NET "Object reference not set to an instance of an
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.