Could not find JAXBContextFinder for media type: application/json

时光毁灭记忆、已成空白 提交于 2019-12-08 04:30:30

RestEasy no longer includes JSON support in the JARs. http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html_single/index.html#JAXB_+_JSON_provider

You need to go get a JAX-B JSON library from http://jettison.codehaus.org/

Please try including @DoNotUseJAXBProvider for the method that you are getting the error for. This worked for me. But this was for text/html This is mentioned in http://docs.jboss.com/seam/3/rest/snapshot/reference/en-US/html_single/

http://jettison.codehaus.org/ not work for me because the .jar in this website not work with resteasy.

You must download resteasy-jettison-provider.jar because this jar implement jettison for resteasy (work for me) : http://www.java2s.com/Code/Jar/r/Downloadresteasyjettisonproviderjar.htm

I used jackson provider

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson-provider</artifactId>
        <version>2.0.1.GA</version>
    </dependency>

and solved problem.

note that resteasy-jackson-provider depends on resteasy-jettison-provider

adding the following jar resolved my issue:

<dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jettison-provider</artifactId>
        <version>2.2.0.GA</version>
</dependency>   
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!