lightcouch / LightCouch

CouchDB Java API
www.lightcouch.org
Apache License 2.0
68 stars 70 forks source link

java.lang.IllegalArgumentException: Cannot override built-in adapter for class com.google.gson.JsonObject with gson 2.11.x #82

Open jamesnetherton opened 6 months ago

jamesnetherton commented 6 months ago

The framework my project uses upgraded gson to 2.11.0. This results in an IllegalArgumentException being thrown from CouchDbClientBase.initGson:

Caused by: java.lang.IllegalArgumentException: Cannot override built-in adapter for class com.google.gson.JsonObject
    at com.google.gson.GsonBuilder.registerTypeAdapter(GsonBuilder.java:714)
    at org.lightcouch.CouchDbClientBase.initGson(CouchDbClientBase.java:699)
    at org.lightcouch.CouchDbClientBase.<init>(CouchDbClientBase.java:95)
    at org.lightcouch.CouchDbClient.<init>(CouchDbClient.java:119)

There was a similar issue reported in the Apache Camel project:

https://issues.apache.org/jira/browse/CAMEL-20800

lightcouch commented 6 months ago

Thanks for reporting the issue.

We'll look into that in our current code update.