|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Extracting meaningful info from ExceptionList |
« View previous topic :: View next topic » |
Author |
Message
|
sudhanshus |
Posted: Tue Jan 28, 2014 12:34 am Post subject: Extracting meaningful info from ExceptionList |
|
|
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 |
|
 |
Esa |
Posted: Tue Jan 28, 2014 1:06 am Post subject: |
|
|
 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 |
|
 |
sudhanshus |
Posted: Tue Jan 28, 2014 1:28 am Post subject: |
|
|
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 |
|
 |
dogorsy |
Posted: Tue Jan 28, 2014 2:50 am Post subject: |
|
|
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 |
|
 |
Esa |
Posted: Tue Jan 28, 2014 3:19 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|