The "spring-boot-starter-test" package:3.1.5" carries with it an incomplete implementation of the "json" library, which leads to an error in runtime #41201
Labels
status: duplicate
A duplicate of another issue
The "spring-boot-starter-test:3.1.5" there is a dependency on the library "jsonassert:1.5.1" which in turn has a dependency on the library "android-json:0.0.20131108.vaadin1".
The latter contains its own implementation of the "json" library from the group "org.json" (https://mvnrepository.com/artifact/org.json/json).
This implementation is incomplete and incompatible with the API declared in the original library, namely the org.json.JSONArray class does not have the "isEmpty" method.
This leads to the addition of the "spring-boot-starter-test" dependency:3.1.5" to a project that already uses the library "json:20220924" leads to the replacement of the original library with an implementation from "android-json:0.0.20131108.vaadin1".
And as a result, your application will crash in runtime with the error "java.lang.NoSuchMethodError 'boolean org.json.JSONArray.isEmpty()"if you use this method anywhere in your code.
Of course, you can solve the problem by excluding this library from the package "spring-boot-starter-test" for example, using the element in MAVEN
but nevertheless, I think it's worth solving this problem in another way - not to supply the "spring-boot-starter-test" library package with this "android-json" dependency.:0.0.20131108.vaadin1".
The text was updated successfully, but these errors were encountered: