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

Radosław Janas commented on CXF-3782:
-------------------------------------

200 OK is also returned while invoking of non existing service.

I see nice log: No root resource matching request path /app/someService has 
been found, Relative Path: /someService. Please enable FINE/TRACE log level for 
more details.

I see that internally cxf throws 
WebApplicationException(org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor:151)
 with 404 NOT FOUND status (but without content body) and finally I get 200 
OK...

> Inconsistent response when throwing WebApplicationException with or without 
> message in Response object
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3782
>                 URL: https://issues.apache.org/jira/browse/CXF-3782
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.4.2
>            Reporter: Radosław Janas
>
> I'm using cxf rest impl.
> I wrote simple rest service which takes xml body.
> When I throw WebApplicationException with Response object containing message 
> (cxf makes it internally i.e. when xml is not schema valid):
> {code}
> Response r = 
> Response.status(400).type(MediaType.TEXT_PLAIN).entity(message).build();
> throw new WebApplicationException(t, r);
> {code}
> ... I get 400 Bad Request with text body
> When I throw WebApplicationException Response object NOT containing message 
> (cxf makes it internally i.e. when request body is empty):
> {code}
> Response r = Response.status(400).type(MediaType.TEXT_PLAIN).build();
> throw new WebApplicationException(t, r);
> {code}
> ... I get 200 OK.
> Why ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to