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
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
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
>> 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
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
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
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
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
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