-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Jersey 3.0.1 no longer defaults to */* consumes #4722
Comments
I hit a similar thing but on 2.33 and with Either using an explicit The workaround mentioned in the original post also works in this case. |
The HTTP status 415 means that there is no MessageBodyReader for media type Until Jersey 3.32/3.0.1 the module jersey-media-jaxb was a mandatory dependency to jersey-core-server. When we made that optional, the JAX-B providers capable of handling I agree that when no entity is read or written, the message body provider is not required. That is handled by the fix. |
JAX-RS section 3.5 says:
We have applications that run on Java 11, do not declare
@Consumes
, and have endpoints like this, which rely on a custom media type:This approach was working in Jersey 3.0.0, but as of Jersey 3.0.1, the client now receives HTTP 415:
Exception
From a brief investigation, it appears that in 3.0.0, the
@Consumes("*/*")
onXmlRootObjectJaxbProvider
was being detected byMethodSelectingRouter
, but this is presumably longer happening as of #4634. Our application does not use JAXB at all, but adding explicitjakarta.xml.bind-api
andjersey-media-jaxb
dependencies works around the issue (this workaround is not really satisfactory, but was done to illustrate the point).The text was updated successfully, but these errors were encountered: