#DuplicateJsonObjectContextCustomizer object

45 messages · Page 1 of 1 (latest)

vast heart
#

can anyone tell me how to exclude it i am new

Found multiple occurrences of org.json.JSONObject on the class path:

        jar:file:/C:/Users/ashir/.m2/repository/org/json/json/20250517/json-20250517.jar!/org/json/JSONObject.class
        jar:file:/C:/Users/ashir/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar!/org/json/JSONObject.class
You may wish to exclude one of them to ensure predictable runtime behavior
cold flameBOT
#

This post has been reserved for your question.

Hey @vast heart! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

spark spindle
#

Are you using Maven or Gradle?

#

Currently, you have different dependencies that bring in both org.json:json:jar:20250517 and com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1 which have the same code/are in conflict with each other

#

You can probably exclude the vaadin one

vast heart
#

maven

spark spindle
#

Can you show your pom.xml?

#

and the output of mvn dependency:tree

#

In the dependency causing the issue, you can probably do something like the following:

<dependency>
  ...
  <exclusions>
    <exclusion>
      <groupid>com.vaadin.external.google</groupId>
      <artifactId>android-json</artifactId>
    </exclusion>
  </exclusions>
</dependency>
vast heart
spark spindle
#

Can I see the output of mvn dependency:tree? That should show that android-json somewhere

#

Alternatively, you can probably fix it by just removing

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20250517</version>
        </dependency>

but to be honest, I'd rather exclude the other one

vast heart
#

i think i used this somewhere so warning came other one not using

spark spindle
#

ok

#

You have this:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
#

Replace it by

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
              <exclusion>
                <groupId>com.vaadin.external.google</groupId>
                <artifactId>android-json</artifactId>
              </exclusion>
            </exclusions>
        </dependency>
vast heart
#

ok

spark spindle
#

because that's where the problematic dependency comes from:

[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.5.7:test // LEVEL 1 - direct dependency
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:3.5.7:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:3.5.7:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.9.0:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.4:runtime
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:2.1.4:runtime
[INFO] |  +- net.minidev:json-smart:jar:2.5.2:test
[INFO] |  |  \- net.minidev:accessors-smart:jar:2.5.2:test
[INFO] |  |     \- org.ow2.asm:asm:jar:9.7.1:test
[INFO] |  +- org.assertj:assertj-core:jar:3.27.6:test
[INFO] |  +- org.awaitility:awaitility:jar:4.2.2:test
[INFO] |  +- org.hamcrest:hamcrest:jar:3.0:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.12.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.12.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.3.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.12.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.12.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.12.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.12.2:test
[INFO] |  +- org.mockito:mockito-core:jar:5.17.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.17.8:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.3:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:5.17.0:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.3:test // LEVEL 2 - transitive dependency
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test // LEVEL 3 - transitive problematic dependency
#

so you can exclude the transitive dependency causing the issue

vast heart
spark spindle
#

oh I probably made a typo

#

yeah, it should be groupId, not groupid

#

I updated the message from before

vast heart
#

oh ok np

#

fixed

spark spindle
#

Then you can try running mvn clean verify to see whether it worked ;)

vast heart
#

2025-11-17T21:30:25.321+05:30 WARN 8564 --- [ restartedMain] org.hibernate.orm.deprecation : HHH90000025: MySQLDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
should i remove it

spark spindle
cold flameBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

frozen fable
spark spindle
frozen fable
#

Well technically the android-vaadin library is just a fork of the org.json from 2013 with a standard license and all bugs actually tested, while org.json started to actually fix these bug in recent years.

cold flameBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

vast heart
#

2025-11-19T06:49:52.759+05:30 WARN 4244 --- [-10:housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-10 - Thread starvation or clock leap detected (housekeeper delta=6h17m41s489ms239µs400ns).

@spark spindle do u know about this

cold flameBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

spark spindle
#

@cold flame is getting these every time I'm doing updates lol

spark spindle
#

or maybe it could be something about your code bring in an endless loop or something blocking forever- if this happens on a server, create a thread dump

#

also it can happen when changing your system time or maybe timezone

#

maybe also if you are somehow manually obtaining DB connections and not releasing them

vast heart
#

Yes my laptop throw this log

spark spindle
#

then it's probably just that - you suspended it, turned it on again and then it detected that the clock suddenly jumped by 6h