当前位置:网站首页>Gson converts the entity class to JSON times declare multiple JSON fields named

Gson converts the entity class to JSON times declare multiple JSON fields named

2022-07-07 08:41:00 coder_ monarch

A problem I encountered when testing the project on the user server today , Log printing is :
java.lang.IllegalArgumentException:…declares multiple JSON fields named …

Use the same version locally jdk and tomcat, There is no error in running the project , Background query sql Get it to the local database and execute , There was no error .

I found many solutions online , Most of them say that the subclasses and superclasses of entity classes have the same attributes , But there is no inheritance of subclasses and parent classes in the project , So overturn this conjecture .

First check the environment , Use the same version locally jdk and tomcat, There is no error in running the project ;
Secondly, the background query sql Get it to the database and execute , There was no error ;
Finally, it is suspected that the project version is inconsistent , So copy the complete project back to the user server , Use it again after configuration tomcat After running, I still report the same problem .

I tried to modify the program several times but failed

Observe carefully sql The results of the investigation , It turns out that there are clob Data of type , But in the local database varchar2 Data of type ; Therefore, it is speculated that the reason is the database version .

Carefully analyze the backstage sql, Used wn_concat Function to put the found multiple pieces of data together and display them on the front desk , Because the server is clob Data of type , Cause data type mismatch , So the front desk reported an error .

原网站

版权声明
本文为[coder_ monarch]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070552128949.html