You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ognjen Blagojevic <og...@gmail.com> on 2011/01/27 13:08:01 UTC

Global exception handling

Hi,

I have a web service with several hundred methods, each of which may 
throw a RuntimeException.

I need to to do certain action (log, send email) when exception is 
thrown, and then to re-throw it. Is it possible to do that globally 
(using some kid of global exception handler), W/O nesting try-catch 
block in every method?

Regards,
Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Global exception handling

Posted by Ognjen Blagojevic <og...@gmail.com>.
Thank you, I will check it out.

-Ognjen


On 28.1.2011 14:42, haipeng du wrote:
> Here is one link to write your own module.
> http://axis.apache.org/axis2/java/core/docs/modules.html
>
> On Fri, Jan 28, 2011 at 1:31 AM, Ognjen Blagojevic
> <ognjen.d.blagojevic@gmail.com <ma...@gmail.com>>
> wrote:
>
>     Hi Du,
>
>     I was hoping that was possible, but I am unable to find any
>     reference in the documentation how to do that.
>
>     Could you provide any pointers how can I configure Axis2 to use my
>     exception handler?
>
>     -Ognjen
>
>
>
>     On 27.1.2011 17:16, haipeng du wrote:
>
>         I think you can write your own handler and configure axis2.xml to
>         process exception.
>
>         2011/1/27 Ognjen Blagojevic <ognjen.d.blagojevic@gmail.com
>         <ma...@gmail.com>
>         <mailto:ognjen.d.blagojevic@gmail.com
>         <ma...@gmail.com>>>
>
>
>             Hi,
>
>             I have a web service with several hundred methods, each of
>         which may
>             throw a RuntimeException.
>
>             I need to to do certain action (log, send email) when
>         exception is
>             thrown, and then to re-throw it. Is it possible to do that
>         globally
>             (using some kid of global exception handler), W/O nesting
>         try-catch
>             block in every method?
>
>             Regards,
>             Ognjen
>
>
>           ---------------------------------------------------------------------
>             To unsubscribe, e-mail:
>         java-user-unsubscribe@axis.apache.org
>         <ma...@axis.apache.org>
>         <mailto:java-user-unsubscribe@axis.apache.org
>         <ma...@axis.apache.org>>
>
>             For additional commands, e-mail:
>         java-user-help@axis.apache.org
>         <ma...@axis.apache.org>
>         <mailto:java-user-help@axis.apache.org
>         <ma...@axis.apache.org>>
>
>
>
>
>
>         --
>         Haipeng Du
>         Salt Lake City
>
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>     <ma...@axis.apache.org>
>     For additional commands, e-mail: java-user-help@axis.apache.org
>     <ma...@axis.apache.org>
>
>
>
>
> --
> Haipeng Du
> Salt Lake City


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Global exception handling

Posted by haipeng du <ha...@gmail.com>.
Here is one link to write your own module.
http://axis.apache.org/axis2/java/core/docs/modules.html

On Fri, Jan 28, 2011 at 1:31 AM, Ognjen Blagojevic <
ognjen.d.blagojevic@gmail.com> wrote:

> Hi Du,
>
> I was hoping that was possible, but I am unable to find any reference in
> the documentation how to do that.
>
> Could you provide any pointers how can I configure Axis2 to use my
> exception handler?
>
> -Ognjen
>
>
>
> On 27.1.2011 17:16, haipeng du wrote:
>
>> I think you can write your own handler and configure axis2.xml to
>> process exception.
>>
>> 2011/1/27 Ognjen Blagojevic <ognjen.d.blagojevic@gmail.com
>> <ma...@gmail.com>>
>>
>>
>>    Hi,
>>
>>    I have a web service with several hundred methods, each of which may
>>    throw a RuntimeException.
>>
>>    I need to to do certain action (log, send email) when exception is
>>    thrown, and then to re-throw it. Is it possible to do that globally
>>    (using some kid of global exception handler), W/O nesting try-catch
>>    block in every method?
>>
>>    Regards,
>>    Ognjen
>>
>>    ---------------------------------------------------------------------
>>    To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>    <ma...@axis.apache.org>
>>
>>    For additional commands, e-mail: java-user-help@axis.apache.org
>>    <ma...@axis.apache.org>
>>
>>
>>
>>
>>
>> --
>> Haipeng Du
>> Salt Lake City
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Haipeng Du
Salt Lake City

Re: Global exception handling

Posted by Ognjen Blagojevic <og...@gmail.com>.
Hi Du,

I was hoping that was possible, but I am unable to find any reference in 
the documentation how to do that.

Could you provide any pointers how can I configure Axis2 to use my 
exception handler?

-Ognjen


On 27.1.2011 17:16, haipeng du wrote:
> I think you can write your own handler and configure axis2.xml to
> process exception.
>
> 2011/1/27 Ognjen Blagojevic <ognjen.d.blagojevic@gmail.com
> <ma...@gmail.com>>
>
>     Hi,
>
>     I have a web service with several hundred methods, each of which may
>     throw a RuntimeException.
>
>     I need to to do certain action (log, send email) when exception is
>     thrown, and then to re-throw it. Is it possible to do that globally
>     (using some kid of global exception handler), W/O nesting try-catch
>     block in every method?
>
>     Regards,
>     Ognjen
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>     <ma...@axis.apache.org>
>     For additional commands, e-mail: java-user-help@axis.apache.org
>     <ma...@axis.apache.org>
>
>
>
>
> --
> Haipeng Du
> Salt Lake City


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Global exception handling

Posted by haipeng du <ha...@gmail.com>.
I think you can write your own handler and configure axis2.xml to process
exception.

2011/1/27 Ognjen Blagojevic <og...@gmail.com>

> Hi,
>
> I have a web service with several hundred methods, each of which may throw
> a RuntimeException.
>
> I need to to do certain action (log, send email) when exception is thrown,
> and then to re-throw it. Is it possible to do that globally (using some kid
> of global exception handler), W/O nesting try-catch block in every method?
>
> Regards,
> Ognjen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Haipeng Du
Salt Lake City