$.ajax函数调接口,报异常No converter found for return value of type: class java.util.ArrayList
2024-09-03 04:23:44
接口正常执行,返回给前端后报服务器500异常,异常详情:
org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class java.util.ArrayList
原因没有深究,大概是$.ajax函数在前端接收的数据类型为JSON,而服务中没有能将ArrayList转换成JSON的类。
暂时记下解决方案——在项目中添加JSON全家桶的依赖如下:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.9</version>
</dependency>
最新文章
- ListView.setAdapter(adapter);空指针异常的解决的总结
- shell数组操作
- docker push到本地仓库失败
- codeforces #round363 div2.C-Vacations (DP)
- ubuntu 双屏问题的解决方案
- sharepoint 浏览页面导航不正确
- 【shell】if
- Introduction to the Build Lifecycle
- 查询select
- maven之pom
- 201521123100 《java程序设计》第12周学习总结
- MongoDB Java
- 关于FIFO异步复位的问题
- STL之vector容器详解
- GIS开发之数据查询
- 003_饿了么chaosmonkey实现
- OSGI命令
- element-ui 表格翻页多选,数据回显
- hdu-6058 Kanade&#39;s sum
- CentOS6.4挂载读写NTFS分区 (重要)