当前位置:网站首页>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类型的数据,导致数据类型不匹配,所以前台报错。
边栏推荐
- IP地址的类别
- 字符串操作
- How to integrate app linking services in harmonyos applications
- 2-3查找树
- Installation and configuration of PLSQL
- IP guard helps energy enterprises improve terminal anti disclosure measures to protect the security of confidential information
- Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
- 数据分片介绍
- Splunk中single value视图使用将数值替换为文字
- Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月6日-新手快速上手-可无缝升级tp6版本
猜你喜欢

Merge sort and non comparison sort

Novice entry SCM must understand those things

调用华为游戏多媒体服务的创建引擎接口返回错误码1002,错误信息:the params is error

Rsync remote synchronization

Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers

Splunk中single value视图使用将数值替换为文字

Componentspace2022, assertions, protocols, bindings, and configuration files

Interpreting the practical application of maker thinking and mathematics curriculum

Obsidan之数学公式的输入

How to integrate app linking services in harmonyos applications
随机推荐
Practice of implementing cloud native Devops based on rainbow library app
Composer change domestic image
[Chongqing Guangdong education] accounting reference materials of Nanjing University of Information Engineering
Golan idea IntelliJ cannot input Chinese characters
接口作为参数(接口回调)
说一个软件创业项目,有谁愿意投资的吗?
Openvscode cloud ide joins rainbow integrated development system
数据中台落地实施之法
IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全
Splunk查询csv lookup table数据动态查询
23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP
In go language, function is a type
String operation
MES系统,是企业生产的必要选择
Automatic upgrading of database structure in rainbow
Ebpf cilium practice (2) - underlying network observability
Opencv learning note 4 - expansion / corrosion / open operation / close operation
Famine cloud service management script
字符串操作
Xcit learning notes