cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Help with Declarative Services and ExceptionMapper
Date Mon, 20 Dec 2010 10:29:41 GMT
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 <info.tech@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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message