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 » Handling deepest error level in WMB7 ExceptionList

Post new topic  Reply to topic
 Handling deepest error level in WMB7 ExceptionList « View previous topic :: View next topic » 
Author Message
vininx
PostPosted: Wed Mar 07, 2012 8:20 pm    Post subject: Handling deepest error level in WMB7 ExceptionList Reply with quote

Acolyte

Joined: 13 Oct 2009
Posts: 69

Hi All,
I have used the below ESQL for capturing deepest level of error from the exception tree list. For some reason, not getting the "Text" values from "Insert" field name in the exception.

Code:

-- Loop through the exception list children
declare abc REFERENCE TO InputExceptionList.*[1];
DECLARE insertNo INTEGER 0;
DECLARE insertBase INTEGER 1;
DECLARE Path CHARACTER;
DECLARE work CHARACTER;
set Path = 'Environment.Variables.BrokerData';
WHILE abc.Number IS NOT NULL do
-- keep track of the deepest error
set Environment.Variables.BrokerData.LastError.Label = abc.Label;
set Environment.Variables.BrokerData.LastError.Number = cast(abc.Number as char);
set Environment.Variables.BrokerData.LastError.Text = abc.Text;
-- record the error information in tree format
EVAL( 'set ' || Path || '.' || FIELDNAME(abc) || '.Label = ''' || abc.Label ||
''';');
--Error text might contain quotes so must replace one single quote (') with
-- two single quotes ('') so EVAL interprets properly
set work = abc.Text;
set work = replace(work, '''', '''''');
EVAL( 'set ' || Path || '.' || FIELDNAME(abc) || '.Text = ''' || work || ''';');
EVAL( 'set ' || Path || '.' || FIELDNAME(abc) || '.Number = ''' || cast(abc.Number
as char) || ''';');
set insertNo = insertBase;
WHILE FIELDNAME(abc.*[insertNo]) = 'Insert' do
EVAL('set ' || Path || '.' || FIELDNAME(abc) || '.Insert[' ||
cast(insertNo - insertBase + 1 as character) || '].Text = abc.*[' ||
cast(insertNo as char) || '].*[2];');
set insertNo = insertNo + 1;
END WHILE;
set Path = Path || '.*[<]';
-- Move start to the last child of the field to which it currently points
MOVE abc LASTCHILD;
END WHILE;


Trace output
--------------
Code:

['MQROOT' : 0x9c76020]
  (0x01000000:Name):RecoverableException = (
    (0x03000000:NameValue):File             = 'F:\build\S700_P\src\DataFlowEngine\ImbMqOutputNode.cpp' (CHARACTER)
    (0x03000000:NameValue):Line             = 905 (INTEGER)
    (0x03000000:NameValue):Function         = 'ImbMqOutputNode::evaluate' (CHARACTER)
    (0x03000000:NameValue):Type             = 'ComIbmMQOutputNode' (CHARACTER)
    (0x03000000:NameValue):Name             = 'RoutingFileNodeFlow#FCMComposite_1_2' (CHARACTER)
    (0x03000000:NameValue):Label            = 'RoutingFileNodeFlow.RoutingOutput' (CHARACTER)
    (0x03000000:NameValue):Catalog          = 'BIPmsgs' (CHARACTER)
    (0x03000000:NameValue):Severity         = 3 (INTEGER)
    (0x03000000:NameValue):Number           = 2230 (INTEGER)
    (0x03000000:NameValue):Text             = 'Caught exception and rethrowing' (CHARACTER)
    (0x01000000:Name     ):MessageException = (
      (0x03000000:NameValue):File     = 'F:\build\S700_P\src\DataFlowEngine\ImbMqOutputNode.cpp' (CHARACTER)
      (0x03000000:NameValue):Line     = 2186 (INTEGER)
      (0x03000000:NameValue):Function = 'ImbMqOutputNode::putMessage' (CHARACTER)
      (0x03000000:NameValue):Type     = 'ComIbmMQOutputNode' (CHARACTER)
      (0x03000000:NameValue):Name     = 'RoutingFileNodeFlow#FCMComposite_1_2' (CHARACTER)
      (0x03000000:NameValue):Label    = 'RoutingFileNodeFlow.RoutingOutput' (CHARACTER)
      (0x03000000:NameValue):Catalog  = 'BIPmsgs' (CHARACTER)
      (0x03000000:NameValue):Severity = 3 (INTEGER)
      (0x03000000:NameValue):Number   = 2667 (INTEGER)
      (0x03000000:NameValue):Text     = 'Failed to put message' (CHARACTER)
      (0x01000000:Name     ):Insert   = (
        (0x03000000:NameValue):Type = 2 (INTEGER)
        (0x03000000:NameValue):Text = '-1' (CHARACTER)
      )
      (0x01000000:Name     ):Insert   = (
        (0x03000000:NameValue):Type = 5 (INTEGER)
        (0x03000000:NameValue):Text = 'MQW102' (CHARACTER)
      )
      (0x01000000:Name     ):Insert   = (
        (0x03000000:NameValue):Type = 2 (INTEGER)
        (0x03000000:NameValue):Text = '2051' (CHARACTER)
      )
      (0x01000000:Name     ):Insert   = (
        (0x03000000:NameValue):Type = 5 (INTEGER)
        (0x03000000:NameValue):Text = '' (CHARACTER)
      )
      (0x01000000:Name     ):Insert   = (
        (0x03000000:NameValue):Type = 5 (INTEGER)
        (0x03000000:NameValue):Text = '' (CHARACTER)
      )
      (0x01000000:Name     ):Insert   = (
        (0x03000000:NameValue):Type = 5 (INTEGER)
        (0x03000000:NameValue):Text = 'JAVACOMPUTE.ROUTING.OUT' (CHARACTER)
      )
    )
  )


Log output:-
-------------
Code:

<ExceptionData>
   <LastError>
      <Label>RoutingFileNodeFlow.RoutingOutput</Label>
      <Number>2667</Number>
      <Text>Failed to put message</Text>
   </LastError>
   <RecoverableException>
      <Label>RoutingFileNodeFlow.RoutingOutput</Label>
      <Text>Caught exception and rethrowing</Text>
      <Number>2230</Number>
      <MessageException>
         <Label>RoutingFileNodeFlow.RoutingOutput</Label>
         <Text>Failed to put message</Text>
         <Number>2667</Number>
      </MessageException>
   </RecoverableException>
</ExceptionData>


On debugging I found that for some reason, the while condition fails. Hence I am unable to get the text in Insert field. Please help me in fixing the issue.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Mar 07, 2012 10:27 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Quote:

On debugging I found that for some reason, the while condition fails. Hence I am unable to get the text in Insert field. Please help me in fixing the issue.


What does a UserTrace tell you?

You never know, it might be very enlightening indeed.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Esa
PostPosted: Wed Mar 07, 2012 11:48 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

You have cooked up quite a brute force approach. But I have seen similar. For some reason people tend to end up with overcomplicated exception logging solutions.

Not even bothering to think what may go wrong with your EVAL's I suggest you read what the InfoCenter says about REFERENCEs. Moving a reference is the fastest and most economic way to reach the bottom of an exception list, like this for example
Code:
DECLARE ref REFERENCE to InputExceptionList;
MOVE ref FIRSTCHILD;
WHILE LASTMOVE(ref) DO
  MOVE ref LASTCHILD;
END WHILE;
MOVE ref PARENT;
IF FIELDNAME(ref) = 'Insert' THEN
  MOVE ref PARENT;
END IF;


And then you can just copy the contents of ref to you Environment place. Or if you prefer to copy the inserts manually, I suggest you do that by moving a reference, too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Handling deepest error level in WMB7 ExceptionList
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.