-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
NoSuchMethodError when using spring-boot-starter-test due to transitive dependency on incomplete clean room implementation of org.json:json #9248
Comments
Do you have a complete stacktrace? It looks like this is a similar issue to #8706 and I'm curious if you're also using Unfortunately the We can't just drop the dependency because some of our own JSON test utilities require it. |
Since this is the second time this issue has been raised we should look to see if we can add some more documentation at least. |
How about a
|
You also have the option to extend the android-json implementation to have the same API. In fact, I did so the other day to extend the JSONException class to have the full constructor list. It was pretty easy to contribute to. Myself, being deep into the JSON-Java code am wary of doing much implementation in Android-json, but others who have not spent much time on either code base shouldn't have an issue bringing the android API up to date. |
IMHO, there is indeed a procedure to tackle this problem:
add exclusion:
eventually, all dependencies of
|
@SollyTaylor or you could simply upgrade to the latest 1.5.x that doesn't bring that dependency anymore. |
@snicoll I test the upgraded versions, 1.5.9.RELEASE and 1.5.10.RELEASE are still complaining the Here is the dep.log of
|
@SollyTaylor read the tree you've pasted. The dependency comes from |
Hi,
I recently upgraded a large application to "spring boot 1.5.3" and since the upgrade we had a runtime issue with the JSON Lib (org.json) pulled in by "spring-boot 1.5.3 RELEASE". There was no issue with compiling / building but at runtime certain calls to "com.json.JSONObject" threw a error like this:
After spending alot of time debugging the issue was found to be with spring-boot-starter-test pulling in "android-json" (com.vaadin.external.google). This also has a JSONObject with fully qualified name "com.json.JSONObject" but not the same methods. It was this JSON object that was getting used at runtime and was causing the method not found errors.
We got around the problem by exluding "android-json" from "spring-boot-starter-test" but I suggest it should not be included by default so as to avoid this kind of issue for others.
Thanks,
William
The text was updated successfully, but these errors were encountered: