I am following the tutorial https://spring.io/guides/gs/actuator-service/
And when I try to run the App I get:
Failed to instantiate SLF4J LoggerF
I add this dependency and problem resolved.
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
you just use version of logback-classic if this error occurred.
The issue does not exists with version 1.3.5. I changed my version to
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
It works !!
We can skip logging dependency and it will work for us.
`<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>`
It may be a version problem, I change my version of springboot from 2.0.0.RELEASE to 1.5.4.RELEASE, the exception disappeared.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
</parent>
You need to find log4j and add in your classpath.
See that message: (you manage dependency duplicate, for dependency transitive, that cause dependency duplicate with differents versions)
Class path contains multiple SLF4J bindings. SLF4J: Found binding in
make a test if use IDE Eclipse
short cut key: Shift+Ctrl+T
that way you see what file has contains this class:
SLF4J: Found binding in [jar:file:
/C:/Users/Josh/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar!
/org/slf4j/impl/StaticLoggerBinder.class]
[jar:file:/C:/Users/Josh/.m2/repository/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.jar!
/org/slf4j/impl/StaticLoggerBinder.class]
repeat class in
slf4j-log4j12-1.7.21.jar
logback-classic-1.1.7.jar
find your same dependency and exclusion what don't you need in your project
that way:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.0-beta2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
</exclusions>
that one example, change for your context