spring boot 2.2: newest classgraph is not loaded
See original GitHub issuewhen the spring boot container is started, the following error occurs:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.webjars.WebJarAssetLocator.findWebJars(WebJarAssetLocator.java:122)
The following method did not exist:
io.github.classgraph.Resource.getClasspathElementURI()Ljava/net/URI;
The method's class, io.github.classgraph.Resource, is available from the following locations:
jar:file:/C:/Users/X048833/.m2/repository/io/github/classgraph/classgraph/4.6.32/classgraph-4.6.32.jar!/io/github/classgraph/Resource.class
It was loaded from the following location:
file:/C:/Users/X048833/.m2/repository/io/github/classgraph/classgraph/4.6.32/classgraph-4.6.32.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of io.github.classgraph.Resource
the mvn dependency:tree -Dverbose
command shows that the newest version 4.8.44
is omitted, instead the version 4.6.32
is used.
[INFO] +- org.springdoc:springdoc-openapi-ui:jar:1.1.49:compile
[INFO] | +- (org.springdoc:springdoc-openapi-core:jar:1.1.49:compile - omitted for duplicate)
[INFO] | +- org.webjars:swagger-ui:jar:3.24.0:compile
[INFO] | \- org.webjars:webjars-locator:jar:0.37:compile
[INFO] | +- org.webjars:webjars-locator-core:jar:0.41:compile (version managed from 0.39)
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.28:compile - version managed from 1.7.7; omitted for duplicate)
[INFO] | | +- (io.github.classgraph:classgraph:jar:4.8.44:compile - omitted for conflict with 4.6.32)
+- org.springdoc:springdoc-openapi-core:jar:1.1.49:compile
[INFO] | +- org.springdoc:springdoc-openapi-common:jar:1.1.49:compile
[INFO] | | +- (org.springframework.boot:spring-boot-autoconfigure:jar:2.2.0.RELEASE:compile - version managed from 2.0.9.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-web:jar:5.2.0.RELEASE:compile - version managed from 5.0.13.RELEASE; omitted for duplicate)
[INFO] | | +- io.swagger.core.v3:swagger-models:jar:2.0.10:compile
[INFO] | | | \- (com.fasterxml.jackson.core:jackson-annotations:jar:2.10.0:compile - version managed from 2.9.10; omitted for duplicate)
[INFO] | | +- io.swagger.core.v3:swagger-annotations:jar:2.0.10:compile
[INFO] | | +- io.swagger.core.v3:swagger-integration:jar:2.0.10:compile
[INFO] | | | +- io.github.classgraph:classgraph:jar:4.6.32:compile
Thanks for fixing this.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Error starting Springboot when update version to 2.7.0 "An ...
classgraph :classgraph but their versions are incompatible. Spring Boot's dependency management for webjars-core-locator uses version 0.50 .
Read more >Getting Started Quickly, Easily and Reliably with Spring Boot ...
This guide walks you through building and running a simple Spring Boot, Apache Geode ClientCache application using the Spring Boot for Apache Geode...
Read more >Hot-swap not working in Spring Boot application
I am out of ideas. I have followed these instructions: Intellij IDEA – Spring boot reload static file is not working and searched...
Read more >Maintaining a medium-sized Java library in 2022 and beyond
Why not Bach? 2.1.4. Maven it is. 2.2. My Maven best practices. 2.2.1. ... Andy Wilkinson in "Migrating Spring Boot's Build to Gradle"....
Read more >java.lang.NoSuchMethodError in java - Gatling Community
... but this is the funny thing → we are using java, not scala, ... /.m2/repository/org/springframework/boot/spring-boot-starter-json/2.4.7 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like
springdoc-openapi-ui
depends onspringdoc-openapi-core
to include correct version ofio.github.classgraph
. But in version1.1.49
an accident happened andspringdoc-openapi-ui
for some reason assumes newer version of that dependency, which is not there.I’m sure guys will update it in next release. For now it can be fixed by simply excluding and forcing the dependency like this:
@Simbosan,
springdoc-openapi-webflux-core is included by transitivity when you declare springdoc-openapi-webflux-ui. Please note, that declaring the following is enough for a project :
If you are facing any dependencies problem, you can add the link to a simple demo project to reproduce it.