cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] Commented: (CXF-2903) Unexpected HTTP response code for @Consumes mismatch
Date Mon, 26 Jul 2010 20:30:17 GMT


Sergey Beryozkin commented on CXF-2903:

I can definitely see a test verifying 415 being returned and I suspect TCK would've failed

I'm just curious, could it be that 

int status = pathMatched == 0 ? 404 : methodMatched == 0 ? 405
: consumeMatched == 0 ? 415 : produceMatched == 0 ? 406 : 404;

is broken a bit (too complicated) and say JVM spec makes it vague enough to figure out how
this if loop is executed ?

Which SDK do you use ?
I feel that the only thing that I can do is to write the explicit if expression and hope it
fixes it for you. If you could download CXF 2.2.9 source and put a breakpoint in JAXRSUtils.findTargetMethod,
at a point where the above expression is executed then it would really help

> Unexpected HTTP response code for @Consumes mismatch
> ----------------------------------------------------
>                 Key: CXF-2903
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.2.9
>            Reporter: Donal Fellows
>         Attachments: taverna.log
> I have an interface with a method annotated as accepting XML (with {{@Consumes("application/xml")}}
and {{@POST}}) and a class that implements that interface; the {{@Path}} is not matched for
{{@POST}} by any other method. When I call it and pass in content with that MIME type, it
all works. When I pass in content of another MIME type, I get a 404 response; this is unexpected,
as I'd expect a 406 (Not Acceptable) response that tells me to pass in XML (to be clear, this
_is_ an error case). Having to work around this by accepting all types and doing my own content
type negotiation is unacceptable, especially since that decreases the utility of the generated
WADL file significantly. Surely CXF should be doing this sort of work for me?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message