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 IndexIBM MQ Java / JMSIBM Message Service Client (XMS) for .NET unhandled exceptio

Post new topicReply to topic
IBM Message Service Client (XMS) for .NET unhandled exceptio View previous topic :: View next topic
Author Message
KrisF
PostPosted: Wed Feb 08, 2012 7:14 am Post subject: IBM Message Service Client (XMS) for .NET unhandled exceptio Reply with quote

Newbie

Joined: 08 Feb 2012
Posts: 6

I'm uncertain as to whether or not I am in the right forum. If not, please re-direct me. Thanks.

I'm using IBM Message Service Client (XMS) for .NET (aka ia9h_2.0.0.6) to produce/consume messages to/from WebSphere Application Server v6.1.0.37 using JMS. My .NET client application is having to handle an exception being thrown in the XMS code. The client trace contains ...

System.NullReferenceException: Object reference not set to an instance of an object.
at IBM.XMS.Comms.IoRequest.DispatchRequestCompleteCallback()
at IBM.XMS.Comms.IoRequest.IoCompleteInternal(Int32 bytesTransferred, Exception ex)
at IBM.XMS.Comms.IoRequest.IoCompleteCallback(IAsyncResult ar)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

I have also captured xms_trace_XXXX.log files with significantly more information. Can anyone help me discern the root cause of this problem??? Thanks for your help.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 08, 2012 7:16 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Can you show the code that receives this exception?

Please make sure to wrap it in [ c o d e ] tags.
Back to top
View user's profile Send private message
KrisF
PostPosted: Wed Feb 08, 2012 7:25 am Post subject: Reply with quote

Newbie

Joined: 08 Feb 2012
Posts: 6

Yes, here is my application code that handles the exception...
Code:

public static void Application_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Exception ex = e.ExceptionObject as Exception;

            if (ex != null)
                systemLog.Fatal("Application unhandled exception occurred", ex);
            else
            {
                systemLog.Fatal("Application unhandled exception occurred");
                systemLog.Fatal(e);
            }
        }

[/code]
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 08, 2012 7:28 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'm sorry, I wasn't terribly clear.

I mean the code that is generating the exception, not the code that is handling the exception.
Back to top
View user's profile Send private message
KrisF
PostPosted: Wed Feb 08, 2012 7:43 am Post subject: Reply with quote

Newbie

Joined: 08 Feb 2012
Posts: 6

No problem. Here is my producing code...
Code:

            try
            {
                if (!ep.InitJMSConnection(out errMsg))
                {
                    ep.CloseConnection();
                    return EndpointResult.ConnectionTimeout;
                }

                if ((ep.TextMessage != null)
                    && (ep.Producer != null)
                    && (data != null))
                {
                    ep.TextMessage.Text = data;
                    ep.Producer.Send(ep.TextMessage, ep.JmsDeliveryMode, ep.JmsPriority, ep.TimeToLive);
                }
                else
                {
                    //  This should never happen ... famous last words.
                    errMsg = ep.ShortPath + " JmsXMSProduceOperation PerformOperation null producer, message, or data.";
                    ep.CloseConnection();
                    return EndpointResult.ConnectionTimeout;
                }
            }
            catch (Exception ex)
            {
                errMsg = ep.ShortPath + " JmsXMSProduceOperation PerformOperation send exception.\n" + ex.Message;
                ep.CloseConnection();
                return EndpointResult.ConnectionTimeout;    //  Fix FogBugz #209 ... replaced Error with ConnectionTimeout
            }


And here is my consuming code...
Code:

                        try
                        {
                            if (systemLog.IsDebugEnabled) systemLog.Debug(Thread.CurrentThread.Name + ": invoking consumer.receive");
                            msg = consumer.receive(PollingRate);

                            UpdateState(TriggerState.Running, "");
                        }
                        catch (Exception ex)
                        {
                            HandleConnectionProblem(ShortPath + " BFJMSTrigger receive Exception occurred: " + ex.Message, 30, false);  //  30 seconds (arbitrary)
                            break;
                        }


As you can see, my producer and consumer both have local exception handling (try-catch) code, but the unhandled exception seems to be getting thrown by an XMS thread that is associated with my application's process.

Here is an excerpt from the xms_trace_XXXX.log...
06:04:55.061250 2808.0084 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+- d IoCompleteInternal(): Exception received: System.ArgumentOutOfRangeException: limit is 194
Parameter name: value
Actual value was 388.
at IBM.XMS.Util.Impl.ByteBufferImpl.set_Position(Int32 value)
at IBM.XMS.Comms.IoRequest.IoCompleteInternal(Int32 bytesTransferred, Exception ex)
at IBM.XMS.Comms.IoRequest.IoCompleteCallback(IAsyncResult ar)
06:04:55.061250 2808.0085 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-- < IoCompleteCallback exit
06:04:55.061250 2808.0084 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-- > DispatchRequestCompleteCallback entry
06:04:55.062226 2808.0083 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- d IoCompleteInternal(): Exception received: System.ArgumentOutOfRangeException: limit is 16
Parameter name: value
Actual value was 32.
at IBM.XMS.Util.Impl.ByteBufferImpl.set_Position(Int32 value)
at IBM.XMS.Comms.IoRequest.IoCompleteInternal(Int32 bytesTransferred, Exception ex)
at IBM.XMS.Comms.IoRequest.IoCompleteCallback(IAsyncResult ar)
06:04:55.051484 2808.0086 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-- > DispatchRequestCompleteCallback entry
06:04:55.062226 2808.0083 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---- > DispatchRequestCompleteCallback entry
06:04:55.063203 2808.0086 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- > IoCompleteInternal entry
06:04:55.064179 2808.0086 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- d IoCompleteInternal(): Exception received: System.NullReferenceException: Object reference not set to an instance of an object.
at IBM.XMS.Comms.IoRequest.DispatchRequestCompleteCallback()
at IBM.XMS.Comms.IoRequest.IoCompleteInternal(Int32 bytesTransferred, Exception ex)
at IBM.XMS.Comms.IoRequest.IoCompleteCallback(IAsyncResult ar)
06:04:55.065156 2808.0086 IBM.XMS.Comms.IoRequest ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---- > DispatchRequestCompleteCallback entry

The timestamp exactly corresponds with the unhandled exception in my application's log.

Incidentally, thanks for your VERY RAPID response. I appreciate it very much!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 08, 2012 7:55 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The most relevant piece appears to be
Quote:
received: System.ArgumentOutOfRangeException: limit is 194
Parameter name: value
Actual value was 388.


But I can't tell from here what's causing that.
Back to top
View user's profile Send private message
KrisF
PostPosted: Wed Feb 08, 2012 8:08 am Post subject: Reply with quote

Newbie

Joined: 08 Feb 2012
Posts: 6

Yes, that kind of problem does seem to be a prevalent prefix to the eventual problem. There are actually several more of them reported just prior to those I pasted in my previous reply. To me it's interesting that the "Actual value" is always exactly twice as large as the "limit". Another point of interest is that the System.ArgumentOutOfRangeException exception appears to be getting handled properly whereas the System.NullReferenceException is not.

If you agree that the problem is originating in the XMS code, where do we go from here? It seems like we need someone from IBM who is intimate with the xms_trace_XXXX.log to educate us as to what is going on in there. Your thoughts?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 08, 2012 8:12 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25170
Location: Ohio, USA

KrisF wrote:
It seems like we need someone from IBM who is intimate with the xms_trace_XXXX.log to educate us as to what is going on in there. Your thoughts?


If you need an IBM person, you need a PMR.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
KrisF
PostPosted: Wed Feb 08, 2012 8:25 am Post subject: Reply with quote

Newbie

Joined: 08 Feb 2012
Posts: 6

I'm sorry, I was just asking for your thoughts. Are you saying, Vitor, that you agree that there is a bug in the XMS code?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 08, 2012 8:31 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It really doesn't matter whether or not we agree that there's a bug in the code.

If you need an official IBM response at all, you need to open a PMR.

I can't tell if the issue represents a bug in the XMS code or not. It might be a bug in your code somewhere. I don't know what the relevant value represented ties back to - whether or not that's driven from a value in your code or from an internal XMS value.

I also can't tell if there are other, external, factors that might be affecting things - like connection issues at the network level or imposed connection limits at the application, network, or queue manager level.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 08, 2012 8:32 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25170
Location: Ohio, USA

KrisF wrote:
I'm sorry, I was just asking for your thoughts.


My thoughts are that if you want an IBM person to guide you through the trace then you need a PMR. There are any number of IBM people wandering round in here, any of whom may be familiar with this part of the product and may have the time & inclination to post. You could easily wait for this to happen. Or you could raise a PMR and get a guaranteed response inside an SLA. You are emplowed with choice.

KrisF wrote:
Are you saying, Vitor, that you agree that there is a bug in the XMS code?


I'd be fairly surprised if there was a bug in the XMS code. What's quite clearly happening is that it's not doing what you expect & you have some trace you need IBM's help to interpret. A PMR is the route to obtain this. As a license paying customer you have the right to this assistance.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 08, 2012 8:39 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25170
Location: Ohio, USA

Case in point:

I had a PMR open last week regarding some odd behaviour setting namespaces in ESQL. I didn't think there was a bug in ESQL, and even got the namespaces set correctly in the end, but raised a PMR to get an explaination of why my original code didn't work as I expected.

The result was my problem being described as "interesting" by the support desk, proof that WMB was behaving exactly as documented and exactly as intended. The outcome was me going "oh...right!" & adding some feedback here that they could use an Example 4 to illustrate another incorrect usage!

PMR != code bug in IBM product.
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Wed Feb 08, 2012 9:39 am; edited 1 time in total
Back to top
View user's profile Send private message
KrisF
PostPosted: Wed Feb 08, 2012 8:56 am Post subject: Reply with quote

Newbie

Joined: 08 Feb 2012
Posts: 6

Hmmm, sounds like I need to open a PMR. I have never had to do that. Can you point me in the right direction? Where do I start? Again, thanks for your help.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 08, 2012 9:13 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://www14.software.ibm.com/webapp/set2/sas/f/handbook/getsupport.html
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSIBM Message Service Client (XMS) for .NET unhandled exceptio
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.