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 » Extracting meaningful info from ExceptionList

Post new topic  Reply to topic
 Extracting meaningful info from ExceptionList « View previous topic :: View next topic » 
Author Message
sudhanshus
PostPosted: Tue Jan 28, 2014 12:34 am    Post subject: Extracting meaningful info from ExceptionList Reply with quote

Novice

Joined: 28 Oct 2013
Posts: 19

Hi,
I have a java compute node that has following code in the catch block of evaluate method:-

Code:
throw new MbUserException(this, "", "evaluate()", e.toString(), "", null);


Code:


Now there's a error handler subflow that extracts the meaningful out of this ExceptionList. Like where the exception ocurred, cause of the exception, type of the exception etc.

When I see ExceptionList, I don't find any definite pattern so that my error handler code fetches the relevant information from the exception list. Be it exception arising in java compute node or broker node.

It's a generic issue but after spending a lot of time doing googling, I couldn't find any conclusive procedure.

Please help.

Back to top
View user's profile Send private message
Esa
PostPosted: Tue Jan 28, 2014 1:06 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

If you want to capture meaningful info you should serialise the stackTrace and throw it instead of e.toString().
Back to top
View user's profile Send private message
sudhanshus
PostPosted: Tue Jan 28, 2014 1:28 am    Post subject: Reply with quote

Novice

Joined: 28 Oct 2013
Posts: 19

Esa wrote:
If you want to capture meaningful info you should serialise the stackTrace and throw it instead of e.toString().


Done. Thanks.

Code:
throw new MbUserException(this.getClass().getName(), "PrepareForLogging evaluate", JCNodeMessages.MESSAGE_SOURCE,
               JCNodeMessages.JCEX, "exception",new String[] {e.getMessage(), id, stackTraceToString});


The problem i am having is the location. I can see my stacktrace in one of the Insert node Text value. What's the location this stacktrace text would be populated in all the cases? Is there a way through which we could dictate how this exception list values and its locations are populated?
Back to top
View user's profile Send private message
dogorsy
PostPosted: Tue Jan 28, 2014 2:50 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

sudhanshus wrote:
Esa wrote:
If you want to capture meaningful info you should serialise the stackTrace and throw it instead of e.toString().


Done. Thanks.

Code:
throw new MbUserException(this.getClass().getName(), "PrepareForLogging evaluate", JCNodeMessages.MESSAGE_SOURCE,
               JCNodeMessages.JCEX, "exception",new String[] {e.getMessage(), id, stackTraceToString});


The problem i am having is the location. I can see my stacktrace in one of the Insert node Text value. What's the location this stacktrace text would be populated in all the cases? Is there a way through which we could dictate how this exception list values and its locations are populated?


You need to look for the UserException in the tree and get the data from there. The exception list tree structure is explained here:
http://pic.dhe.ibm.com/infocenter/wmbhelp/v9r0m0/topic/com.ibm.etools.mft.doc/ac00540_.htm

and examples on how to access the exception list tree using esql:

http://pic.dhe.ibm.com/infocenter/wmbhelp/v9r0m0/topic/com.ibm.etools.mft.doc/ac16830_.htm
Back to top
View user's profile Send private message
Esa
PostPosted: Tue Jan 28, 2014 3:19 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

sudhanshus wrote:


The problem i am having is the location. I can see my stacktrace in one of the Insert node Text value. What's the location this stacktrace text would be populated in all the cases? Is there a way through which we could dictate how this exception list values and its locations are populated?


Yes. You dictate it with your code. In your code example you are dictating that the stackTrace is to be put in the third Insert.

But why put a dummy "exception" in Exception.Text when you can put the stackTrace there directly:

Code:
throw new MbUserException(this.getClass().getName(), "PrepareForLogging evaluate", JCNodeMessages.MESSAGE_SOURCE,
               JCNodeMessages.JCEX, stackTraceToString",null);
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 » Extracting meaningful info from 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.