-
Bug
-
Resolution: Done
-
Major
-
1.2.1.GA
-
None
I created an ExeptionMapper :
@Provider
public class NotFoundExceptionMapper implements ExceptionMapper<NotFoundException> {
private static final Logger LOG = Logger.getLogger(NotFoundExceptionMapper.class);
@Context
HttpHeaders httpHeaders;
/*
- (non-Javadoc)
- @see javax.ws.rs.ext.ExceptionMapper#toResponse(java.lang.Throwable)
*/
@Override
public Response toResponse(final NotFoundException exception) { // TODO add to docs: INTERNAL_SERVER_ERROR LOG.error("Exception is being handled by NotFoundExceptionMapper"); LOG.error(exception.getMessage()); return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR).type(httpHeaders.getMediaType().toString()).build(); }}
When I try to access non-existant url I got the following stacktrace :
SEVERE: Servlet.service() for servlet Resteasy threw exception
org.jboss.resteasy.spi.LoggableFailure: Unable to inject contextual data of type: javax.ws.rs.core.HttpHeaders
at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:53)
at $Proxy16.getRequestHeader(Unknown Source)
- is related to
-
RESTEASY-300 Unable to inject contextual data of type: javax.ws.rs.core.Request
- Closed