Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread xav
Hi Tim, Jb, It's works, Here the solution: Extension @Component(property = {"*osgi.jaxrs.extension=true*"}) @Produces(MediaType.APPLICATION_JSON) public class RestExceptionMapper implements ExceptionMapper { .. .. } Ressource @Component(property = { "*osgi.jaxrs.resource=true*" }, serv

Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread Tim Ward
I note that you’re using the Component Property annotations for the extension, but a raw property entry for the resource. If your build plugin is able to cope with Component Property annotations then you can use the @JaxrsResource annotation instead of a magic string. If your build plugin can’t

Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread xav
Hi tim, I use JAXRS resource My RestExceptionMapper is coded like this @JaxrsExtension @Component(service = RestExceptionMapper.class, name = "RestExceptionMapper", immediate = true) public class RestExceptionMapper implements ExceptionMapper My ressources @Component( property

Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread Tim Ward
>> I don't know if, the aries withboard project (1.0.4) has implemented the >> spec? As Aries JAX-RS Whiteboard is the reference implementation I can say with reasonable confidence that it has implemented the specification. The issue is that the application code you have supplied isn’t using the

Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread Jean-Baptiste Onofré
Do you have a JAXRS Application containing the ExceptionMapper or are you using JAXRS resource ? Regards JB On 02/04/2019 11:28, xav wrote: > Hi JB, > > Yes I did, but it's does not work!! > The Exception is throw in the console, and not trap to put my own http > response. > So ??? > I don't kno

Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread xav
Hi JB, Yes I did, but it's does not work!! The Exception is throw in the console, and not trap to put my own http response. So ??? I don't know if, the aries withboard project (1.0.4) has implemented the spec? Thx Xav -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread Tim Ward
Hi Xavier, The JAX-RS whiteboard works as a whiteboard, not an extender. In order to register your extension service (the ExceptionMapper) with the whiteboard you need to supply the correct service properties. In this case you need. osgi.jaxrs.extension=true If you’re using OSGi R7 declarativ

Re: ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread Jean-Baptiste Onofré
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-whi

ExceptionMapper on Aries JAX-RS Whiteboard on karaf 4.2.3 and above.

2019-04-02 Thread xav
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 { .. .. } But unfortunately, my exce