spring mvc通过@RequestMapping("/register")和@ResponseBody返回json格式的字符串时出现如下异常:
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.

  控制台没有任何异常信息输出,找了很久发现需要如下包:

jackson-core-asl-1.9.9-redhat-1.jar
jackson-jaxrs-1.9.9-redhat-1.jar
jackson-mapper-asl-1.9.9-redhat-1.jar
spring-web-servlet-3.1.2.RELEASE.jar 

  如果是eclipse,加入jar包以后记得刷新项目后重启。否则加入的包不一定生效。

相关文章:

  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2021-05-12
  • 2021-11-24
  • 2021-08-03
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-07-16
  • 2021-09-16
相关资源
相似解决方案