网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

出现Springboot整合Gson报错问题怎么办

这篇文章主要为大家展示了出现Springboot整合Gson报错问题怎么办,内容简而易懂,希望大家可以学习一下,学习完之后肯定会有收获的,下面让小编带大家一起来看看吧。

成都创新互联公司于2013年开始,先为项城等服务建站,项城等地企业,进行企业商务咨询服务。为项城企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

在Springboot 中依赖Gson,项目启动时报错:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

  java.lang.invoke.MethodHandleNatives.resolve(Native Method)

The following method did not exist:

  com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;

The method's class, com.google.gson.GsonBuilder, is available from the following locations:

  jar:file:/D:/8_maven/mvnrepo/com/google/code/gson/gson/2.5/gson-2.5.jar!/com/google/gson/GsonBuilder.class

It was loaded from the following location:

  file:/D:/8_maven/mvnrepo/com/google/code/gson/gson/2.5/gson-2.5.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of com.google.gson.GsonBuilder

解决办法:

将pom中依赖的Gson版本更换为2.6以上即可



  com.google.code.gson
  gson
  2.8.6

以上就是关于出现Springboot整合Gson报错问题怎么办的内容,如果你们有学习到知识或者技能,可以把它分享出去让更多的人看到。


网站栏目:出现Springboot整合Gson报错问题怎么办
链接URL:http://bjjierui.cn/article/jgphie.html

其他资讯