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 » WebSphere Message Broker (ACE) Support » createElementAsLastChildFromBitstream throws no exception

Post new topic  Reply to topic
 createElementAsLastChildFromBitstream throws no exception « View previous topic :: View next topic » 
Author Message
christian witschel
PostPosted: Fri Feb 08, 2008 1:51 am    Post subject: createElementAsLastChildFromBitstream throws no exception Reply with quote

Apprentice

Joined: 07 Dec 2005
Posts: 27

Hi,

Ich have the following Java Problem:

I use method createElementAsLastChildFromBitstream from MbElement to parse a byte array.
Works very nice, rather too nice. Even if the byte array content actually does not match the message set description I pass into the method.

How can I validate that createElementAsLastChildFromBitstream actually parsed a valid byte array.

For example I have a message set definition using a number of fixed length fields adding up to a line length of 124 characters. if I pass in the byte array of a string with 160 or 100 characters, the method still does not throw an Exception.

If I use a ApplyMessageSetNode with the same values on the other hand it will always throw an exception if the String was not 124 chars.


Any idea is welcome!
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Fri Feb 08, 2008 4:04 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Interesting. Not sure about this one yet:
- What is an 'ApplyMessageSet' node. Is that another name for ResetContentDescriptor?
- What exception do you get when you use ApplyMessageSetNode?
- Did you have validation enabled in the messsage flow when using ApplyMessageSet?

If you are getting a validation exception, then you're stuck. You cannot enable validation via createElementAsLastChildFromBitstream.
Back to top
View user's profile Send private message
christian witschel
PostPosted: Fri Feb 08, 2008 7:35 am    Post subject: Reply with quote

Apprentice

Joined: 07 Dec 2005
Posts: 27

Hi,

Right, it is the ResetContentDescriptor node (just call it ApplyMessageSet all the time, my mistake).
The error message from the ResetContentDescriptior node will depend on what is wrong with the string. If it is too short then it will say for example:

(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '2'
)
(0x01000000):ParserException = (
(0x03000000):File = '/build/S600_P/src/MTI/MTIforBroker/MtiImbParser2/MtiImbParser.cpp'
(0x03000000):Line = 614
(0x03000000):Function = 'MtiImbParser::parseRightSibling'
(0x03000000):Type = 'ComIbmResetContentDescriptorNode'
(0x03000000):Name = 'MCCSK_INTERFACES#FCMComposite_1_44'
(0x03000000):Label = 'MCCSK_INTERFACES.Apply_MSet_MCCSK_GMS_SCS_INVPAY'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 5285
(0x03000000):Text = 'ImbRecoverableException caught from worker->parseNext.'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '2014_GMS_INV_PAY_INPUT'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'TDS1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'I2014_GMS_INV_PAY_INPUT'
)
(0x01000000):ParserException = (
(0x03000000):File = '/build/S600_P/src/cpi/pwf/nxd/nxdworker.cpp'
(0x03000000):Line = 456
(0x03000000):Function = 'NXDWorker::parseNext'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 1
(0x03000000):Number = 5421
(0x03000000):Text = 'TDS General Error'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '113^TAX_AMOUNT'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '/I2014_GMS_INV_PAY_INPUT/53^line/96^DETAIL/113^TAX_AMOUNT'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '10818'
)
(0x01000000):ParserException = (
(0x03000000):File = '/build/S600_P/src/cpi/pwf/nxd/nxdscanner.cpp'
(0x03000000):Line = 103
(0x03000000):Function = 'NXDScanner::extractFixedLengthData'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 5426
(0x03000000):Text = 'Not enough data in bitstream'
)
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Fri Feb 08, 2008 7:56 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

What happens if you specify the message format name incorrectly? ( just trying to find out whether you are getting *any* exceptions from the parser)
Back to top
View user's profile Send private message
christian witschel
PostPosted: Fri Feb 08, 2008 7:57 am    Post subject: Reply with quote

Apprentice

Joined: 07 Dec 2005
Posts: 27

one thought just came to me:

my createElementAsLastChildFromBitstream is within a try catch block just for this statement. I am catching java.lang.Exception. Could it be that a Parsing exception is a recoverable exception? Maybe recoverable exceptions are not thrown like normal exception in java but are working a different way? like MbNode.getRecoverableExceptions() (made up)
Back to top
View user's profile Send private message Send e-mail
christian witschel
PostPosted: Fri Feb 08, 2008 8:02 am    Post subject: Reply with quote

Apprentice

Joined: 07 Dec 2005
Posts: 27

kimbert wrote:
What happens if you specify the message format name incorrectly? ( just trying to find out whether you are getting *any* exceptions from the parser)


No exception is thrown. The element created is just empty (children or values).

could it be that I somehow turned something off?
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Fri Feb 08, 2008 8:38 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I am catching java.lang.Exception
Well, are you rethrowing the exception after catching it? If not, it will be discarded and the method will continue after the catch block. That could explain the symptoms.
Back to top
View user's profile Send private message
christian witschel
PostPosted: Fri Feb 08, 2008 8:45 am    Post subject: Reply with quote

Apprentice

Joined: 07 Dec 2005
Posts: 27

Thats not it.

I am rethrowing and also writing an entry to a log file.
Also the code after the method still within the same try catch is executed and then has a problem with an empty node.

Neither happens. So there must be no exception
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Mon Feb 11, 2008 2:21 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I'm out of ideas - what you are describing sounds like a defect.
Unless anybody else has an idea, I suggest you open a PMR. If you do, please include the URL of this thread so that IBM service have the background.
Back to top
View user's profile Send private message
christian witschel
PostPosted: Wed Mar 26, 2008 4:32 am    Post subject: Reply with quote

Apprentice

Joined: 07 Dec 2005
Posts: 27

Hi,

problem solved.
The PMR clarified that the method truely does not throw an exception, because no parsing actually takes place within it.
Calling this method just tells the broker to ready itself for parsing. The actual parsing takes place when the result is accessed for the first time. They call this on demand parsing. While parsing then exceptions are thrown.

My problem was that at a later stage when the parsed data was used, there was a debug method that consumed all exceptions the parser threw without doing any log or else.
We removed this method and all other try catch blocks "below". Now all exceptions are caught at one higher central place in the java code.
Works fine now.
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 » WebSphere Message Broker (ACE) Support » createElementAsLastChildFromBitstream throws no exception
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.