Author |
Message
|
sai kumar adduri |
Posted: Tue Dec 17, 2013 2:39 am Post subject: unable to throw exception in external java method |
|
|
Acolyte
Joined: 04 Apr 2013 Posts: 73
|
I am calling an external java which returns a string method from esql , When there is an exception in java , all though it comes to the catch block where I am trying to print it but it is ineffective ,and it is continuing with normal execution. |
|
Back to top |
|
 |
hcinko5 |
Posted: Tue Dec 17, 2013 3:40 pm Post subject: |
|
|
 Novice
Joined: 12 Apr 2010 Posts: 21
|
Without the intention to be offensive, could you remake your question? I don't get what are you asking. Try to give more detail of what is your scenario, your expected outcome and your real outcome. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Dec 17, 2013 10:27 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
My guess is that the OP wants to tell the calling ESQL that there was an exception in the Java code that was called. _________________ 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 |
|
 |
ajodowd |
Posted: Wed Dec 18, 2013 1:09 am Post subject: |
|
|
Novice
Joined: 15 Dec 2013 Posts: 13
|
Yes that makes sense smdavies99.
Sai kumar, it sounds like your java exception is being thrown, and you are stepping through the ESQL in the debugger, but the HANDLER block isn't operating on the exception? Have you looked at the Exception tree, because an exception should be being generated.
Thanks, Anthony. |
|
Back to top |
|
 |
sai kumar adduri |
Posted: Thu Dec 19, 2013 9:11 am Post subject: |
|
|
Acolyte
Joined: 04 Apr 2013 Posts: 73
|
The exception list is not being populated and after entering into the catch block I am trying to print it . |
|
Back to top |
|
 |
McueMart |
Posted: Thu Dec 19, 2013 9:25 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
If you have a try {} catch{} block in java code and you hit an exception , you will of course move to the catch section.
I think the OP is then expecting the 'exception list' i.e. the contact admin.getExceptionList(), to be populated. This will NOT happen.
What you probably want to do is re-throw the exception e.g.
Code: |
try{
...
}catch(Exception e){
MbUserException mbue = new MbUserException(this,"myMethod","","",e.toString(),null);
throw mbue;
}
|
This will re-throw the exception and will be caught by the input node, try-catch node (or a HANDLER if you defined one in your ESQL). |
|
Back to top |
|
 |
|