Springboot中使用GSON报错 An attempt was made to call the method com.google.gson.GsonBuilder.setLenient

错误如下:

 

Description:

An attempt was made to call the method com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; but it does not exist. Its class, com.google.gson.GsonBuilder, is available from the following locations:

  ......
 

这种情况是GSON依赖版本不对,换成2.6以上版本即可,如:

 



   com.google.code.gson
   gson
   2.6.2

你可能感兴趣的:(错误处理,跟我一起玩转,SpringBoot)