cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6376) Unexpected exception thrown from ResponseHandler is swallowed and status code 200 is returned
Date Tue, 28 Apr 2015 16:36:06 GMT

    [ https://issues.apache.org/jira/browse/CXF-6376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14517351#comment-14517351
] 

Sergey Beryozkin commented on CXF-6376:
---------------------------------------

It is a 2.7.x specific regression introduced after I added a support for mapping the exceptions
thrown from non JAX-RS (pure CXF) interceptors...

> Unexpected exception thrown from ResponseHandler is swallowed and status code 200 is
returned
> ---------------------------------------------------------------------------------------------
>
>                 Key: CXF-6376
>                 URL: https://issues.apache.org/jira/browse/CXF-6376
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.15
>            Reporter: Vojtěch Krása
>
> quickstart: https://github.com/krasa/cxf-bug
> mvn jetty:run
> GET http://localhost:8080/cxf/rest/foo
> -> 200 is returned, while the log prints javax.ws.rs.NotFoundException, but no mention
about the exception which occured inside the ResponseHandler 
> Such error can silently break the application:
> {code}
> import javax.ws.rs.core.Response;
> import org.apache.cxf.jaxrs.ext.ResponseHandler;
> import org.apache.cxf.jaxrs.model.OperationResourceInfo;
> import org.apache.cxf.message.Message;
> public class ErrorResponseHandler implements ResponseHandler {
> 	@Override
> 	public Response handleResponse(Message m, OperationResourceInfo ori, Response response)
{
> 		System.out.println("throwing NPE");
> 		throw new NullPointerException();
> 	}
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message