Author |
Message
|
GenCode |
Posted: Fri Oct 02, 2015 11:26 am Post subject: System.FormatException in IBM.XMS.Client.Impl.dll |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
I am having an issue in in one of my messages in a simple read using XMS in .NET
I read all my messages just fine, but when I read about the 19th message the following exception is thrown.
Exception thrown: 'System.FormatException' in IBM.XMS.Client.Impl.dll
Additional information: String was not recognized as a valid DateTime.
the line it throws the XMSException on is
consumer.Receive();
I also tried ReceiveNoWait() but same error on that one message.
Whats confusing is its only the one message but my older version using the older libraries did not have this issue reading this message. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Oct 03, 2015 3:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So what's different in message #19 from all the other messages?
A timestamp in the RFH2 jms section that cannot be parsed correctly maybe?
Or a user property that was defined as timestamp but does not match the timestamp format of the receiver?
What has changed in .NET parsing of DateTime between the 2 versions?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Oct 03, 2015 4:09 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Other than posting here what have done to diagnose the problem?
Is it always the 19th msg that throws the error? Use some utility to move the 19th msg to the 1st or last position in the queue. Does the error move?
How many messages total are in queue? Presuming that there are more than 19 messages in the queue, if you delete the 19th message, does the problem disappear? Or does the problem move to the "new" 19th message?
Use some utility to display in hex the 18th and 19th msgs. How are they different? _________________ 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 |
|
 |
mqjeff |
Posted: Mon Oct 05, 2015 4:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Is it the 19th message? Or is it the 19th Get?
How often are you creating a new connection to MQ? Once for each get?
What does the memory usage of your application look like? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
GenCode |
Posted: Mon Oct 05, 2015 5:49 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
Thanks for the feedback, just returned from the weekend.
> So what's different in message #19 from all the other messages?
Visually there seems to be no difference except the content
> Other than posting here what have done to diagnose the problem?
I ran an older version of the app based on the older amqmdnet dll and it was able to read it.
> How many messages total are in queue? Presuming that there are more than 19 messages in the queue, if you delete the 19th message, does the problem disappear? Or does the problem move to the "new" 19th message?
I assume it would but I did not want to delete the message until I figured out this issue.
> How often are you creating a new connection to MQ? Once for each get?
Tried both ways
Issue is its blowing up inside the IBM DLL not my user code so I really don't know what I can do at this point other than delete it.
Also tried changing to
var msg = (ITextMessage)consumer.Receive();
and
var msg = consumer.ReceiveNoWait();
but no matter what the IBM Receive throws this exception.
This is a client message, not one we produced. Is there anything I can ask the client about it. |
|
Back to top |
|
 |
GenCode |
Posted: Mon Oct 05, 2015 5:52 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
Here is the text content of the message
2015-09-30-15.12.36.294253yyy00000000xxxxxxxyyy01 2015100100000000REJECT 003001DATE EFFECTIVE IS NOT VALID BUS DATE- |
|
Back to top |
|
 |
GenCode |
Posted: Mon Oct 05, 2015 6:13 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
Snapper,
> A timestamp in the RFH2 jms section that cannot be parsed correctly maybe?
That sounds logical, but they are not sending their messages thru jms I don't believe. Is there I can make it ignore the timestamp section on the read? |
|
Back to top |
|
 |
GenCode |
Posted: Mon Oct 05, 2015 9:46 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
Code: |
public bool Consume()
{
if (_disposed)
throw new ObjectDisposedException("Connection is disposed.");
bool retval = false;
IMessage recvMsg = null;
List<IMessage> messages = new List<IMessage>();
using (var scope = new TransactionScope(TransactionScopeOption.Required))
{
while (true)
{
try
{
//recvMsg = consumer.ReceiveNoWait();
recvMsg = (ITextMessage)consumer.Receive();
messages.Add(recvMsg);
if (recvMsg == null) // no more messages, time to leave
{
break;
}
retval = true;
}
catch (XMSException xmsex)
{
WMQCommon.WMQLogging.Log(xmsex);
session.Rollback();
retval = false;
}
catch(Exception ex)
{
WMQCommon.WMQLogging.Log(ex);
session.Rollback();
retval = false;
}
}
session.Rollback(); // this is for testing only, use parser below and remove when done testing.
// _parser.Parse(recvMsg);
} // end scope
connection.Close();
return retval;
}
|
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 05, 2015 9:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Which line throws the exception? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
GenCode |
Posted: Mon Oct 05, 2015 11:58 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
Hi Jeff,
As stated throughout the thread its the IBM call to recieve.
recvMsg = (ITextMessage)consumer.Receive();
Other than options I don't know what I can do. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Oct 05, 2015 6:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So we'll have to presume that the error is in the receive method and not in the cast to (ITextMessage) right? If you look at the message with a utility, say RFHUtil it shows "STRING " as the message format?
What is the content of the JMS tab in RFHUtil? Please specify the content for each field.
What is the content of the user properties (see both RFH user tab and properties tab)?
Have you opened a PMR for this?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
GenCode |
Posted: Tue Oct 06, 2015 4:43 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
> So we'll have to presume that the error is in the receive method and not in the cast to (ITextMessage) right?
Yup, actually we "know" its not a casting issue because I also tried without a cast.
i.e. I tried this, no cast and use var, same error
var testNoCast =consumer.Receive();
Let me see if I can get more info with that util. |
|
Back to top |
|
 |
GenCode |
Posted: Tue Oct 06, 2015 6:46 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
fjb_saper,
I am able to read that message with the browse of the util
here are the answers to your questions.
> RFHUtil it shows "STRING " as the message format?
DATA Tab, Data Format Char, Char Format Ebcdic
> What is the content of the JMS tab in RFHUtil? Please specify the content for each field.
JMS Tab, Everything is blank, JMS Message Type there are no radio buttons set at all.
> What is the content of the user properties (see both RFH user tab and properties tab)?
User Prop tab
User properties is blank, same with usr tab, the box is blank
data
00000000 2015-09-30-15.12.36.294253yyy000
00000032 00000xxxxxxxyyy01 201510010000
00000064 0000REJECT 003001DATE EFFECTIVE
00000096 IS NOT VALID BUS DATE-
00000128 |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 06, 2015 6:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Can you show the amqsbcg/amqsbcgc output of the message? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
GenCode |
Posted: Tue Oct 06, 2015 7:35 am Post subject: |
|
|
Novice
Joined: 10 Sep 2015 Posts: 21
|
Using the IBM utility I went to the
MQMD tab and to me as a the
Put Date/Time
looks odd, its value is the following
0930/20/15 17::1:3:.38
mqjeff,
> Can you show the amqsbcg/amqsbcgc output of the message?
I am not sure if you mean one of the tab in RFHUTIL or using the old .NET DLL? |
|
Back to top |
|
 |
|