Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning about multiple occurrences of org.json.JSONObject #32881

Closed
vpavic opened this issue Oct 26, 2022 · 1 comment
Closed

Warning about multiple occurrences of org.json.JSONObject #32881

vpavic opened this issue Oct 26, 2022 · 1 comment
Assignees
Labels
for: external-project For an external project and not something we can fix

Comments

@vpavic
Copy link
Contributor

vpavic commented Oct 26, 2022

In essence, this is the same problem as #29387.

I ran into this while upgrading an application that uses Jedis as Redis driver to Spring Boot 3.0.0-RC1:

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

	jar:file:/home/vpavic/.gradle/caches/modules-2/files-2.1/org.json/json/20220320/6df2c050972619466f6dcef7654ef9bcc01dfd0/json-20220320.jar!/org/json/JSONObject.class
	jar:file:/home/vpavic/.gradle/caches/modules-2/files-2.1/com.vaadin.external.google/android-json/0.0.20131108.vaadin1/fa26d351fe62a6a17f5cda1287c1c6110dec413f/android-json-0.0.20131108.vaadin1.jar!/org/json/JSONObject.class

You may wish to exclude one of them to ensure predictable runtime behavior

Since its 4.0.0 release, Jedis pulls in org.json:json as a transitive dependency. At the same time, com.vaadin.external.google:android-json is pulled in by org.skyscreamer:jsonassert which in turn is a dependency of spring-boot-starter-test.

At quick glance, Jedis usage of org.json:json is limited to org.json.JSONArray and org.json.JSONObject classes (both of which are offered by com.vaadin.external.google:android-json) so one might be tempted to simply exclude org.json:json, but at the same time there's no guarantee that Jedis won't start using something outside of those two in the future.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 26, 2022
@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Oct 26, 2022
@wilkinsona wilkinsona removed the for: team-meeting An issue we'd like to discuss as a team to make progress label Oct 31, 2022
@philwebb
Copy link
Member

I don't think there's much that we can do that won't make the situation worse. If we exclude the dependency then someone that doesn't happen to have com.vaadin.external.google:android-json will find their application doesn't start. We don't have a starter so we can't easily add com.vaadin.external.google:android-json ourselves.

I've opened redis/jedis#3189 to see if the Jedis project could consider switching implementations or making org.json:json optional.

@philwebb philwebb closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
@philwebb philwebb added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix
Projects
None yet
Development

No branches or pull requests

4 participants