当前位置:网站首页>Gson转换实体类为json时报declares multiple JSON fields named
Gson转换实体类为json时报declares multiple JSON fields named
2022-07-07 05:52:00 【coder_monarch】
今天在用户服务器上测试项目时遇见的一个问题,日志打印是:
java.lang.IllegalArgumentException:…declares multiple JSON fields named …
在本地使用相同版本的jdk和tomcat,运行项目没有报错,后台的查询sql拿到本地数据库中执行,也没有报错。
上网查找了很多解决办法,大部分都说是实体类的子类父类有相同属性的问题,但是项目里面并没有子类父类的继承,因此推翻这个猜想。
首先检查环境,在本地使用相同版本的jdk和tomcat,运行项目没有报错;
其次把后台的查询sql拿到数据库中执行,也没有报错;
最后怀疑是项目版本不一致的原因,因此把完整的项目重新拷贝至用户服务器上,配置好以后再用tomcat跑起来之后还是报相同的问题。
在尝试了几次修改程序但是都失败了
仔细观察sql查出的结果,拿出来在服务器数据库执行后查出的结果集中竟然是有clob类型的数据,但是在本地数据库中是varchar2类型的数据;因此推测是数据库版本的原因。
仔细分析后台sql,使用了wn_concat函数来把查出的多条数据拼在一起展示在前台,由于服务器上是clob类型的数据,导致数据类型不匹配,所以前台报错。
边栏推荐
- [kuangbin]专题十五 数位DP
- Xcit learning notes
- Low success rate of unit test report
- 如何在快应用中实现滑动操作组件
- POJ - 3616 Milking Time(DP+LIS)
- Analyzing the influence of robot science and technology development concept on Social Research
- 联想混合云Lenovo xCloud:4大产品线+IT服务门户
- How to realize the high temperature alarm of the machine room in the moving ring monitoring system
- Ebpf cilium practice (1) - team based network isolation
- AVL平衡二叉搜索树
猜你喜欢
如何在快应用中实现滑动操作组件
打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
Iptables' state module (FTP service exercise)
南京商品房买卖启用电子合同,君子签助力房屋交易在线网签备案
GFS distributed file system
The field value in Splunk subquery fuzzy matching CSV is*
opencv学习笔记一——读取图像的几种方法
Opencv learning notes 1 -- several methods of reading images
MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP
随机推荐
[Yu Yue education] basic reference materials of electrical and electronic technology of Nanjing Institute of information technology
Grpc, oauth2, OpenSSL, two-way authentication, one-way authentication and other column directories
一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
MES系統,是企業生產的必要選擇
Tips for using jeditabletable
归并排序和非比较排序
Low success rate of unit test report
使用SwinUnet训练自己的数据集
Famine cloud service management script
Opencv learning notes II - basic image operations
A method for quickly viewing pod logs under frequent tests (grep awk xargs kuberctl)
Compilation and linking of programs
go写一个在一定时间内运行的程序
A single game with goods increased by 100000, and the rural anchor sold men's clothes on top of the list?
2-3查找树
Open3d ISS key points
调用华为游戏多媒体服务的创建引擎接口返回错误码1002,错误信息:the params is error
JS的操作
Splunk query CSV lookup table data dynamic query
Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?