当前位置:网站首页>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类型的数据,导致数据类型不匹配,所以前台报错。
边栏推荐
猜你喜欢
登山小分队(dfs)
Laravel8 uses passport login and JWT (generate token)
rsync远程同步
Input and output of floating point data (C language)
Rsync remote synchronization
All about PDF crack, a complete solution to meet all your PDF needs
Tuowei information uses the cloud native landing practice of rainbow
Learn how to compile basic components of rainbow from the source code
What is the method of manual wiring in PCB design in 22protel DXP_ Chengdu electromechanical Development Undertaking
Novice entry SCM must understand those things
随机推荐
详解华为应用市场2022年逐步减少32位包体上架应用和策略
[Yu Yue education] C language programming reference of Zhongbei College of Nanjing Normal University
IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全
路由信息协议——RIP
IP地址的类别
GOLand idea intellij 无法输入汉字
Go语言中,函数是一种类型
数据分片介绍
Golang compilation constraint / conditional compilation (/ / +build < tags>)
POJ - 3616 Milking Time(DP+LIS)
Opencv learning note 3 - image smoothing / denoising
JS的操作
打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
GFS分布式文件系统
Grpc, oauth2, OpenSSL, two-way authentication, one-way authentication and other column directories
接口作为参数(接口回调)
How to understand distributed architecture and micro service architecture
快速集成认证服务-HarmonyOS平台
[Chongqing Guangdong education] organic electronics (Bilingual) reference materials of Nanjing University of Posts and Telecommunications
2-3 lookup tree