当前位置:网站首页>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类型的数据,导致数据类型不匹配,所以前台报错。
边栏推荐
- Input and output of floating point data (C language)
- 说一个软件创业项目,有谁愿意投资的吗?
- Splunk查询csv lookup table数据动态查询
- mysql分区讲解及操作语句
- SSM 整合
- Several ways of lambda used in functions in kotlin (higher-order functions)
- Data type - floating point (C language)
- Pvtv2--pyramid vision transformer V2 learning notes
- [hard core science popularization] working principle of dynamic loop monitoring system
- Snyk 依赖性安全漏洞扫描工具
猜你喜欢

2-3查找树

Installation and configuration of PLSQL

快速集成认证服务-HarmonyOS平台

23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP

Opencv learning note 5 - gradient calculation / edge detection

为什么要选择云原生数据库

单场带货涨粉10万,农村主播竟将男装卖爆单?
![[hard core science popularization] working principle of dynamic loop monitoring system](/img/d4/0c0281aec5a4f444528e8cfd401598.jpg)
[hard core science popularization] working principle of dynamic loop monitoring system

使用BiSeNet实现自己的数据集

Automatic upgrading of database structure in rainbow
随机推荐
为什么要选择云原生数据库
2 - 3 arbre de recherche
JEditableTable的使用技巧
Grpc, oauth2, OpenSSL, two-way authentication, one-way authentication and other column directories
Laravel8 uses passport login and JWT (generate token)
redis故障处理 “Can‘t save in background: fork: Cannot allocate memory“
Splunk子查询模糊匹配csv中字段值为*
[Chongqing Guangdong education] organic electronics (Bilingual) reference materials of Nanjing University of Posts and Telecommunications
Opencv learning note 3 - image smoothing / denoising
Low success rate of unit test report
Rainbow combines neuvector to practice container safety management
数据分析方法论与前人经验总结2【笔记干货】
[untitled]
MES系统,是企业生产的必要选择
Iptables' state module (FTP service exercise)
[Yu Yue education] higher vocational English reference materials of Nanjing Polytechnic University
iptables 之 state模块(ftp服务练习)
调用华为游戏多媒体服务的创建引擎接口返回错误码1002,错误信息:the params is error
Opencv learning note 5 - gradient calculation / edge detection
POJ - 3616 Milking Time(DP+LIS)