You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2010/12/20 11:29:41 UTC
Re: Help with Declarative Services and ExceptionMapper
Hi
When using Declarative Services, you may need to specify the names like
this :
<property name="org.apache.cxf.rs.provider">
com.MyExceptionClassPath.TestExceptionMapper
</property>
or
<property name="org.apache.cxf.rs.provider">
com.MyExceptionClassPath.TestExceptionMapper
com.MyExceptionClassPath.TestExceptionMapper2
</property>
Let me know please if it helps
cheers, Sergey
On Mon, Dec 20, 2010 at 2:20 AM, Sisyphus <in...@shaw.ca> wrote:
>
> Greetings,
>
> I am attempting to setup a custom exception handler through CXF-DOSGi using
> Declarative Services to register my provider.
>
> My endpoints registration file (for REST) declares the following:
>
> <property name="org.apache.cxf.rs.provider"
> value="com.MyExceptionClassPath.TestExceptionMapper" />
>
> The class TestExceptionMapper is defined with the following signature and
> default method:
>
> package com.MyExceptionClassPath;
> public class TestExceptionMapper implements
> ExceptionMapper<MyCustomException> {
> public Response toResponse(MyCustomException arg0) {
> return Response.status(Response.Status.FORBIDDEN).build();
> }
> }
>
> I am using SoapUI to call into my web service and I am trying a test of the
> custom exception provider by simply calling:
>
> throw new MyCustomException();
>
> I have a breakpoint set at TestExceptionMapper.toResponse(), but it is
> never
> hit. Instead, the execution stack just falls through MyCustomException.
>
> I must add a common caveat. This is all extremely new to me, so any
> responsdor needs to understand that I do not have a deep background
> (working
> on it) in this technological field.
>
> Thanks for any forthcoming assistance.
>
> Cheers, Ian
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Help-with-Declarative-Services-and-ExceptionMapper-tp3311555p3311555.html
> Sent from the cxf-issues mailing list archive at Nabble.com.
>