当前位置:网站首页>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类型的数据,导致数据类型不匹配,所以前台报错。
边栏推荐
- Low success rate of unit test report
- Lua programming learning notes
- Rapid integration of authentication services - harmonyos platform
- IP guard helps energy enterprises improve terminal anti disclosure measures to protect the security of confidential information
- iptables 之 state模块(ftp服务练习)
- 調用華為遊戲多媒體服務的創建引擎接口返回錯誤碼1002,錯誤信息:the params is error
- DeiT学习笔记
- GOLand idea intellij 无法输入汉字
- 说一个软件创业项目,有谁愿意投资的吗?
- 21 general principles of wiring in circuit board design_ Provided by Chengdu circuit board design
猜你喜欢
如何在快应用中实现滑动操作组件
Calling the creation engine interface of Huawei game multimedia service returns error code 1002, error message: the params is error
Splunk查询csv lookup table数据动态查询
A method for quickly viewing pod logs under frequent tests (grep awk xargs kuberctl)
Implementation of navigation bar at the bottom of applet
Laravel8 uses passport login and JWT (generate token)
MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
Deit learning notes
Golang compilation constraint / conditional compilation (/ / +build < tags>)
Data type - integer (C language)
随机推荐
Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience
Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
Golang 编译约束/条件编译 ( // +build <tags> )
Golang compilation constraint / conditional compilation (/ / +build < tags>)
Laravel8 uses passport login and JWT (generate token)
Thirteen forms of lambda in kotlin
Opencv learning note 3 - image smoothing / denoising
归并排序和非比较排序
Through the "last mile" of legal services for the masses, fangzheng Puhua labor and personnel law self-service consulting service platform has been frequently "praised"
接口作为参数(接口回调)
Learn how to compile basic components of rainbow from the source code
[Yu Yue education] higher vocational English reference materials of Nanjing Polytechnic University
How to integrate app linking services in harmonyos applications
IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全
联想混合云Lenovo xCloud:4大产品线+IT服务门户
Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月6日-新手快速上手-可无缝升级tp6版本
Implementation method of data platform landing
iptables 之 state模块(ftp服务练习)
What is the method of manual wiring in PCB design in 22protel DXP_ Chengdu electromechanical Development Undertaking
Installation and configuration of PLSQL