cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: ExceptionMapper choosing the wrong mapper
Date Wed, 07 Sep 2011 10:21:35 GMT
Hi Alex

On Tue, Sep 6, 2011 at 10:13 PM, Alex Porras <alex@twelve17.com> wrote:
> On Tue, Sep 6, 2011 at 4:12 PM, Alex Porras <alex@twelve17.com> wrote:
>
>> What is happening is that when FooException is thrown in the
>> application, it is being handled by BarExceptionMapper.
>
> I believe I have found the solution.  Despite the child exception
> mappers specifying a generic type required by the parent (abstract)
> exception mapper (which implements ExceptionMapper), each child class
> also needs to include a "implements ExceptionMapper<T>" declaration,
> to prevent CXF from bubbling up to the base interface implementation
> declaration and using that class's generic type.
>
> Thus, my exception mapper hierarchy is now:
>
> (abstract) BaseRuntimeExceptionMapper <T extends BaseRuntimeException>
> FooExceptionMapper extends BaseRuntimeExceptionMapper<FooException>
> implements ExceptionMapper<FooException>
> BarExceptionMapper extends
> BaseRuntimeExceptionMapper<BarException>implements
> ExceptionMapper<BarException>
>
> This seems a little repetitive, but I think it makes sense given the
> route that CXF seems to be using to determine the exception type.
>

I think that has to be improved on the CXF side - I'll try to get to it asap

thanks, Sergey


> Hope this helps someone else!
>
> Alex
>



-- 
Sergey Beryozkin

http://sberyozkin.blogspot.com
Talend - http://www.talend.com

Mime
View raw message