Author |
Message
|
damianharvey |
Posted: Thu Jul 15, 2004 1:32 pm Post subject: Determine line where MRM Parser failed |
|
|
 Acolyte
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
|
Hi all,
I had a problem yesterday where a 27,000 line file failed to be parsed by the MRM parser with the error :
"Not all the buffer was used when reading message"
The problem is that my error message doesn't identify the line where the error occurred. I was wondering if anyone knows of a way to make the Broker give some more meaningful data about where the error occurred. I ended up going through it manually and finding the extra 1 character on lilne 21,657 (that was fun).
Any thoughts?
Cheers,
Damian. |
|
Back to top |
|
 |
kirani |
Posted: Thu Jul 15, 2004 2:04 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Damian,
The error message tells you that your input message is too long for the message definition that you are trying to parse with.
Now the extra char could be at any position within your input message and i don't think it's very easy to find that out. You might get a different error if your numeric fields are not aligned correctly due to this extra char. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
damianharvey |
Posted: Thu Jul 15, 2004 2:09 pm Post subject: |
|
|
 Acolyte
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
|
Kirani,
Thanks. I know it means that it is too long however when you have such a long file, some sort of indication of where the error occurs would be super helpful.
Apparently BizTalk can do this (waits to be slapped). |
|
Back to top |
|
 |
djeripo |
Posted: Thu Jul 15, 2004 8:22 pm Post subject: |
|
|
 Master
Joined: 25 Jan 2004 Posts: 225
|
Once , even I faced the same problem . I was not copying MQMD properly to the outputroot . Once I corrected that it worked fine .
The way I corrected that,
1.)Copy Message Headers.
2.)SET OutputRoot.Properties = NULL;
SET OutputRoot.Properties = InputRoot.Properties;
3.)SET OutputRoot.MQMQ = NULL:
SET OutputRoot.MQMD = InputRoot.MQMD;
4.)SET OutputRoot.MRM = NULL:
Hope this helps ! |
|
Back to top |
|
 |
JT |
Posted: Fri Jul 16, 2004 7:00 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Quote: |
I was wondering if anyone knows of a way to make the Broker give some more meaningful data about where the error occurred |
Try turning on a debug-level trace. |
|
Back to top |
|
 |
kirani |
Posted: Fri Jul 16, 2004 3:52 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
damianharvey wrote: |
Apparently BizTalk can do this (waits to be slapped).
|
OK. Here is an example. Let's say my input message consist of two fields,
FNAME X(5)
LNAME X(5)
Input Data Example,
1. JOHN SMITH
2. JOHN XXSMITH
3. JOHN SMIXXTH
In Example 1. my message with parse fine. In Example 2 and 3, I will get parsing error (as indicated in your first post).
Since you are familiar with BizTalk, does it know which char is causing this error is it TH at the end of message or is it XX in the middle of the message. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
damianharvey |
Posted: Sun Jul 18, 2004 1:01 pm Post subject: |
|
|
 Acolyte
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
|
I'm not familiar with BizTalk but a colleague is and he informs me that, yes, BizTalk will identify the first line that errors and the offending characters.
Turning on a debug trace is fine for investigating once an error has occurred but is off no use to quickly see where the error came from. We log all exceptions to a database and view the logs through a portal. Ideally I would be able to store the line that failed so that it would be easy to fix and resend. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Jul 18, 2004 4:10 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
damianharvey wrote: |
I'm not familiar with BizTalk but a colleague is and he informs me that, yes, BizTalk will identify the first line that errors and the offending characters. |
I think you misunderstood his point. If a string field has too many characters in it, how is any piece of software going to know WHICH characters are the wrong one?
And if you have two string fields in a row, and the total length is too long, how is it to know if there are extra characters from the first field or extra characters from the second field?
WMQI usually, if you use a trace, will show you how much it actually did manage to parse before it threw an error. But the trace is going to be at least as long to look through as the data (in fact, guaranteed to be much longer!).
And there are cases where it is proveably impossible, given a particular model of data (or, for some types of parser, for any model of data) , for a piece of software to properly identify the correct location of the error. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
damianharvey |
Posted: Sun Jul 18, 2004 4:51 pm Post subject: |
|
|
 Acolyte
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
|
Jeff, you're right in that you won't know which characters are wrong, however you should be able to identify the line that is too long and also the characters that push it over the limit.
For example using Kirani's message :
1. JOHN SMITH
2. JOHN XXSMITH
3. JOHN SMIXXTH
I would like to be able to get an error identifying line 2 and the characters "TH" as causing the error.
Thanks.
Damian. |
|
Back to top |
|
 |
kirani |
Posted: Sun Jul 18, 2004 4:59 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
well, currently MRM parser will be able to tell you that line 2 and line 3 have problem. However, it won't tell you that how many chars are extra. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
damianharvey |
Posted: Sun Jul 18, 2004 5:02 pm Post subject: |
|
|
 Acolyte
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
|
Kirani,
If I could get that information I'd be a happy man. I couldn't see it in the exception tree. Do you know where do get it from?
Thanks,
Damian. |
|
Back to top |
|
 |
kirani |
Posted: Sun Jul 18, 2004 7:14 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Damian,
I am assuming that each line is a seperate message on the queue. Is that true? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
damianharvey |
Posted: Sun Jul 18, 2004 7:26 pm Post subject: |
|
|
 Acolyte
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
|
Kirani,
Unfortunately not. An individual message may have approx 30,000 lines (these are Item Master updates). As I mentioned, this was failing due to 2 lines containing additional characters.
The problem is that the exception only tells me that the message was wrong and not that lines 21,657 and 21,894 were the cause.
Thanks,
Damian. |
|
Back to top |
|
 |
kirani |
Posted: Sun Jul 18, 2004 8:02 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
I misunderstood your question before. In my earlier post I was referring to each line as separate message. MRM will not tell you which line has problem as it treats them as repeating elements. I guess you are back to square one. One way would be to design "smart error handler" which will split the message and put back on the queue for processing. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
JLRowe |
Posted: Mon Jul 19, 2004 7:36 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
The just in time parsing may be to your advantage, prior to the code do not refer to any element in the message.
In a compute node, force the parser to read each element by looping through it, store the loop counter and the last element in the environment. When an MRM exception occurs, the environment will contain the context of the exception. This may help. |
|
Back to top |
|
 |
|