No SLF4J providers were found

I am using jmix, when there is an error it does not show them and when loading the application it does not show the localhost in the console

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See SLF4J Error Codes for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [jar:file:/C:/Users/Dynamoware/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.11/4741689214e9d1e8408b206506cbe76d1c6a7d60/logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See SLF4J Error Codes for an explanation.

image

for some reason putting this in the gradle file
implementation ‘org.apache.tika:tika-core:2.6.0’
causes this.

1 Like

This is because tika-core:2.6.0 brings slf4j-api:2.0.3 dependency while Spring Boot 2.7 requires slf4j-api:1.7.x.

Try to either exclude the transitive dependency on SLF4J:

implementation('org.apache.tika:tika-core:2.6.0') {
    exclude group: 'org.slf4j', module: 'slf4j-api'
}

or use the previous version:

implementation 'org.apache.tika:tika-core:2.4.1'
4 Likes

Thanks a lot Mr. Konstantin Krivopustov

@krivopustov Konstantin, it seems that you have introduced the dependency to slf4j-api:2.0.11 via jmix core 1.6.0 and reintroduced this problem by design. Was this intentional? It broke the slf4j logging again …

image

Hello,

Can you provide sample project or build.gradle with this issue? Unable to reproduce on new project.

But the current suspect is json-path.
Try this:

implementation('com.jayway.jsonpath:json-path') {
    exclude group: 'org.slf4j', module: 'slf4j-api'
}

Regards,
Ivan

Sure Ivan, attaching clean jmix 1.6.0 project + added demo logging in test_saveAndLoad (note the @slf4j annotation and lombok import

jmx16logging.7z (3.1 MB)

Run the aforementioned test and get

Task :testClasses
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See SLF4J Error Codes for further details.
SLF4J(W): Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J(W): Ignoring binding found at [jar:file:/home/julius/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.13/e9f3458e7354fe4917081237c01fa4999f4e1b86/logback-classic-1.2.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J(W): See SLF4J Error Codes for an explanation.

Hello.

Please check this topic Error while migrating from 1.5.5 to 1.6.0.
Should be the same issue and fix.

Regards,
Ivan