-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MessageBodyWriter not found for media type application/json when using MOXy #3235
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
+1 Configured Moxy and started facing issue for Long Object response. Is any fix available? |
Issue solved for me when using proper @produces annotation. In this case, it used to be @produces(MediaType.APPLICATION_JSON). Changing it to @produces(MediaType.TEXT_PLAIN) solved the issue. Since the output is Long, it is going through
|
I'm getting the following error in my logs:
org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor aroundWriteTo
Grave: MessageBodyWriter not found for media type=application/json, type=class com.sample.MyDTO, genericType=class com.sample.MyDTO.
In general, it is caused by the lack of registered MessageBodyWriter but in my case, I do have the jersey-media-proxy JAR on the classpath (with all its dependencies). If that helps debugging, I confirm that the configure method of the MoxyJsonFeature is called when my web application is deployed.
I precise I'm using Jersey v2.21. My web application is deployed on Tomcat 8.0.26.
Also, I tried switching to Jackson and it works fine so I assume something is going wrong with MOXy.
Affected Versions
[2.21]
The text was updated successfully, but these errors were encountered: