karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.
Date Tue, 02 Apr 2019 08:42:16 GMT
Hi Xavier,

As you have a RestExceptionMapper dealing with RestCommonException, you
should have:

@GET
@Path("/foo")
public String hello(String message) throws RestCommonException {
...
}

?

Regards
JB

On 02/04/2019 10:27, xav wrote:
> Hi all,
> 
> I use https://github.com/apache/aries-jax-rs-whiteboard on karaf to provide
> a REST API.
> It's works but now I try to provide an ExceptionMapper with the annotation
> @Provider
> 
> @Provider
> public class RestExceptionMapper implements
> ExceptionMapper<RestCommonException> {
> 
> ......
> ......
> }
> 
> But unfortunately, my exception is not trap ????
> In my main class, I write it like this:
> @Component(
>         property = { "osgi.jaxrs.resource=true" },
>         service = SayHelloRestService.class, name = "SayHello", immediate =
> true)
> @Path(REST_PREFIX_RESSOURCE + "sayhello")
> public class SayHelloRestService
> 
> 
> Regards
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message