当前位置:网站首页>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类型的数据,导致数据类型不匹配,所以前台报错。
边栏推荐
- One click installation of highly available Nacos clusters in rainbow
- JEditableTable的使用技巧
- 23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP
- Rsync remote synchronization
- Snyk dependency security vulnerability scanning tool
- Virtual address space
- 2-3查找树
- 【微信小程序:缓存操作】
- Famine cloud service management script
- Splunk中single value视图使用将数值替换为文字
猜你喜欢
单元测试报告成功率低
Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience
Go语言中,函数是一种类型
In go language, function is a type
Obsidan之数学公式的输入
Using nocalhost to develop microservice application on rainbow
Pvtv2--pyramid vision transformer V2 learning notes
【无标题】
調用華為遊戲多媒體服務的創建引擎接口返回錯誤碼1002,錯誤信息:the params is error
What is the method of manual wiring in PCB design in 22protel DXP_ Chengdu electromechanical Development Undertaking
随机推荐
Golang compilation constraint / conditional compilation (/ / +build < tags>)
2 - 3 arbre de recherche
[machine learning] watermelon book data set_ data sharing
Open3D ISS关键点
Analyzing the influence of robot science and technology development concept on Social Research
Pvtv2--pyramid vision transformer V2 learning notes
POJ - 3784 Running Median(对顶堆)
Download and install orcale database11.2.0.4
Rainbow combines neuvector to practice container safety management
Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
AVL balanced binary search tree
使用SwinUnet训练自己的数据集
National SMS center number inquiry
Train your dataset with swinunet
Mock.js用法详解
Data type - floating point (C language)
SSM 整合
MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
Learn how to compile basic components of rainbow from the source code
How to integrate app linking services in harmonyos applications