错误信息:

org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class java.util.ArrayList

如图所示:
【Spring】No converter found for return value of type: class java.util.ArrayList

http://www.cnblogs.com/hafiz/p/5812873.html 提供了一种解决方案,似乎也是很多人的做法,但我试过之后发现不行。

后来发现是版本的问题:升了 jackson 版本后解决。
PS: 又添加了 jackson-annotations 依赖,如下:

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>

————————————————————
初始版本信息:
Spring: 5.0.7.RELEASE
jackson: 2.8.11

更改之后版本信息:
Spring: 5.0.7.RELEASE
jackson: 2.9.5

相关文章:

  • 2021-11-11
  • 2021-08-19
  • 2022-12-23
  • 2021-03-30
  • 2022-01-19
  • 2022-12-23
  • 2021-08-08
  • 2021-05-22
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2021-08-31
  • 2021-06-13
  • 2021-10-20
  • 2021-07-13
  • 2021-12-13
相关资源
相似解决方案