Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[osgi-users] JAX-RS Exception mapper issue

Hi,

I have a JAX-RS service with an ExceptionMapper which returns this in case of error:
No message body writer has been found for class com.castortech.iris.ba.ecore.rest.rest.RestException, ContentType: application/json

I have an ExceptionMapper that I can confirm is activated, and tried with and without the App select below:
@Component(
property = {
JAX_RS_EXTENSION + "=true",
ApiConstants.REST_API_APP_SELECT
}
)
public class DefaultExceptionMapper implements ExceptionMapper<RestException> {

And in the service itself:
return Response
.status(Response.Status.INTERNAL_SERVER_ERROR)
.entity(new RestException(e))
.build();

Changing the service to return the exception message as text/plain works, but it is not really what I would like to do here.

Cheers,
Alain


Back to the top