当前位置:网站首页>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-guard助力能源企业完善终端防泄密措施,保护机密资料安全
- Learn how to compile basic components of rainbow from the source code
- SSM 整合
- National SMS center number inquiry
- [Chongqing Guangdong education] audio visual language reference materials of Xinyang Normal University
- [Chongqing Guangdong education] accounting reference materials of Nanjing University of Information Engineering
- 一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
- Componentspace2022, assertions, protocols, bindings, and configuration files
- Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月6日-新手快速上手-可无缝升级tp6版本
- IELTS review progress and method use [daily revision]
猜你喜欢

Rsync remote synchronization

单元测试报告成功率低

rsync远程同步

归并排序和非比较排序

調用華為遊戲多媒體服務的創建引擎接口返回錯誤碼1002,錯誤信息:the params is error

Opencv learning note 4 - expansion / corrosion / open operation / close operation

Laravel8 uses passport login and JWT (generate token)

【无标题】

2-3 lookup tree

The truth of robot education in hands-on practice
随机推荐
Rsync remote synchronization
Lua programming learning notes
National SMS center number inquiry
Rainbow combines neuvector to practice container safety management
联想混合云Lenovo xCloud:4大产品线+IT服务门户
Tips for using jeditabletable
快速集成认证服务-HarmonyOS平台
Pvtv2--pyramid vision transformer V2 learning notes
如何在快应用中实现滑动操作组件
一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
Using helm to install rainbow in various kubernetes
Go语言中,函数是一种类型
You should use Google related products with caution
数据分析方法论与前人经验总结2【笔记干货】
Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月6日-新手快速上手-可无缝升级tp6版本
POJ - 3784 running medium
Snyk dependency security vulnerability scanning tool
Several ways of lambda used in functions in kotlin (higher-order functions)
Xcit learning notes
[kuangbin] topic 15 digit DP