cancel
Showing results for 
Search instead for 
Did you mean: 

SLF4J Mutiple Binding issue for Java application in SAP BTP

former_member823998
Discoverer
0 Kudos

We have a Java Spring boot application, the application upon deployment to SAP BTP gives below error.

2023-05-25T11:37:46.378+0000 [APP/PROC/WEB/0] STDERR SLF4J: Class path contains multiple SLF4J bindings.<br>2023-05-25T11:37:46.378+0000 [APP/PROC/WEB/0] STDERR SLF4J: Found binding in [jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.2.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]<br>2023-05-25T11:37:46.378+0000 [APP/PROC/WEB/0] STDERR SLF4J: Found binding in [jar:file:/home/vcap/app/META-INF/.sap_java_buildpack/tomcat/lib/logback-classic-1.2.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]<br>2023-05-25T11:37:46.378+0000 [APP/PROC/WEB/0] STDERR SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

Below is my maven dependency tree for your reference

<code>Maven dependency tree :
[INFO] --- maven-dependency-plugin:3.2.0:tree (default-cli) @ poc ---
[INFO] com.sap.uid:poc:war:0.0.7-SNAPSHOT
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] +- com.sap.cloud.security.xsuaa:xsuaa-spring-boot-starter:jar:2.11.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.6.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.6.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.6.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.6.4:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.10:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.10:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.36:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.29:compile
[INFO] |  +- com.sap.cloud.security.xsuaa:spring-xsuaa:jar:2.11.1:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.1:compile
[INFO] |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.17.1:compile
[INFO] |  |  \- com.sap.cloud.security:env:jar:2.11.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-security:jar:2.6.4:compile
[INFO] |  |  \- org.springframework:spring-aop:jar:5.3.16:compile
[INFO] |  +- org.springframework.security:spring-security-oauth2-jose:jar:5.6.2:compile
[INFO] |  |  \- com.nimbusds:nimbus-jose-jwt:jar:9.14:compile
[INFO] |  \- org.springframework.security:spring-security-oauth2-resource-server:jar:5.6.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.6.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.6.4:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.1:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.1:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.1:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.1:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.6.4:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.58:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.58:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.58:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.16:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.16:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.16:compile
[INFO] +- org.springframework.security:spring-security-oauth2-client:jar:5.7.2:compile
[INFO] |  +- org.springframework.security:spring-security-core:jar:5.6.2:compile
[INFO] |  |  \- org.springframework.security:spring-security-crypto:jar:5.6.2:compile
[INFO] |  +- org.springframework.security:spring-security-oauth2-core:jar:5.6.2:compile
[INFO] |  +- org.springframework.security:spring-security-web:jar:5.6.2:compile
[INFO] |  +- org.springframework:spring-core:jar:5.3.16:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.16:compile
[INFO] |  \- com.nimbusds:oauth2-oidc-sdk:jar:9.35:compile
[INFO] |     +- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] |     +- com.nimbusds:content-type:jar:2.2:compile
[INFO] |     +- net.minidev:json-smart:jar:2.4.8:compile
[INFO] |     |  \- net.minidev:accessors-smart:jar:2.4.8:compile
[INFO] |     |     \- org.ow2.asm:asm:jar:9.1:compile
[INFO] |     \- com.nimbusds:lang-tag:jar:1.6:compile
[INFO] +- com.sap.cloud.security.xsuaa:token-client:jar:2.13.0:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.36:compile
[INFO] |  +- com.sap.cloud.security.xsuaa:api:jar:2.13.0:compile
[INFO] |  +- com.sap.cloud.security:java-api:jar:2.13.0:compile
[INFO] |  \- com.github.ben-manes.caffeine:caffeine:jar:2.9.3:compile
[INFO] |     \- org.checkerframework:checker-qual:jar:3.19.0:compile
[INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.5.2.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:5.3.16:compile
[INFO] |  +- org.springframework:spring-context:jar:5.3.16:compile
[INFO] |  +- org.springframework.security:spring-security-config:jar:5.6.2:compile
[INFO] |  \- commons-codec:commons-codec:jar:1.15:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.6.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.6.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.6.4:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.6.0:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
[INFO] |  +- org.assertj:assertj-core:jar:3.21.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.8.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.8.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.8.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.8.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.8.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.8.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.0.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.11.22:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.11.22:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.0.0:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.16:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.8.4:test
[INFO] +- org.json:json:jar:20220320:compile
[INFO] +- org.jetbrains.kotlin:kotlin-reflect:jar:1.3.61:compile
[INFO] |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.3.61:compile
[INFO] |     +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.3.61:compile
[INFO] |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO] +- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.61:compile
[INFO] |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.3.61:compile
[INFO] +- org.jetbrains.kotlin:kotlin-test:jar:1.3.61:test
[INFO] |  \- org.jetbrains.kotlin:kotlin-test-common:jar:1.3.61:test
[INFO] +- com.sap.cloud.sdk.cloudplatform:cloudplatform-connectivity-scp-cf:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:cloudplatform-core:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:caching:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:cloudplatform-connectivity:jar:3.11.0:compile
[INFO] |  |  +- com.sap.cloud.sdk.quality:common:jar:3.11.0:compile
[INFO] |  |  |  \- org.apache.commons:commons-csv:jar:1.7:compile
[INFO] |  |  \- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:cloudplatform-connectivity-scp:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:resilience:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.frameworks:resilience4j:jar:3.11.0:runtime
[INFO] |  |  +- io.github.resilience4j:resilience4j-circuitbreaker:jar:1.2.0:runtime
[INFO] |  |  |  \- io.github.resilience4j:resilience4j-core:jar:1.2.0:runtime
[INFO] |  |  +- io.github.resilience4j:resilience4j-bulkhead:jar:1.2.0:runtime
[INFO] |  |  +- io.github.resilience4j:resilience4j-timelimiter:jar:1.2.0:runtime
[INFO] |  |  +- io.github.resilience4j:resilience4j-cache:jar:1.2.0:runtime
[INFO] |  |  |  \- javax.cache:cache-api:jar:1.1.1:runtime
[INFO] |  |  \- io.github.resilience4j:resilience4j-retry:jar:1.2.0:runtime
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:security:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:cloudplatform-core-scp-cf:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:security-scp-cf:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:servlet:jar:3.11.0:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.1:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:tenant:jar:3.11.0:compile
[INFO] |  +- com.sap.cloud.sdk.cloudplatform:tenant-scp-cf:jar:3.11.0:compile
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.36:runtime
[INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  +- com.google.guava:guava:jar:28.2-jre:compile
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.8.9:compile
[INFO] |  +- com.mikesamuel:json-sanitizer:jar:1.2.0:compile
[INFO] |  +- com.auth0:java-jwt:jar:3.9.0:compile
[INFO] |  +- commons-io:commons-io:jar:2.6:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.15:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] |  +- io.vavr:vavr:jar:0.10.2:compile
[INFO] |  |  \- io.vavr:vavr-match:jar:0.10.2:compile
[INFO] |  \- com.google.errorprone:error_prone_annotations:jar:2.3.4:compile
[INFO] \- com.sap.cloud.sdk.s4hana:s4hana-all:jar:3.72.0:compile
[INFO]    +- com.sap.cloud.sdk.s4hana:s4hana-core:jar:3.72.0:compile
[INFO]    |  \- com.sap.cloud.sdk.datamodel:fluent-result:jar:3.72.0:compile
[INFO]    +- com.sap.cloud.sdk.s4hana:s4hana-connectivity:jar:3.72.0:compile
[INFO]    |  \- com.sap.cloud.sdk.cloudplatform:auditlog:jar:3.72.0:compile
[INFO]    +- com.sap.cloud.sdk.s4hana:s4hana-api-odata:jar:3.72.0:compile
[INFO]    |  +- com.sap.cloud.sdk.datamodel:odata-core:jar:3.72.0:compile
[INFO]    |  \- com.sap.cloud.servicesdk:odata-v2-lib:jar:1.40.11:compile
[INFO]    |     \- com.sap.cloud.servicesdk:developer_license:jar:1.40.11:compile
[INFO]    +- com.sap.cloud.sdk.s4hana:s4hana-api-odata-v4:jar:3.72.0:compile
[INFO]    |  +- com.sap.cloud.sdk.datamodel:odata-v4-core:jar:3.72.0:compile
[INFO]    |  \- com.sap.cloud.sdk.datamodel:odata-client:jar:3.72.0:compile
[INFO]    +- com.sap.cloud.sdk.datamodel:soap:jar:3.72.0:compile
[INFO]    |  +- org.apache.axis2:axis2-adb:jar:1.7.9:compile
[INFO]    |  |  \- org.apache.ws.commons.axiom:axiom-dom:jar:1.2.21:runtime
[INFO]    |  |     \- org.codehaus.woodstox:woodstox-core-asl:jar:4.2.0:runtime
[INFO]    |  |        \- org.codehaus.woodstox:stax2-api:jar:3.1.1:runtime
[INFO]    |  +- org.apache.axis2:axis2-transport-http:jar:1.7.9:compile
[INFO]    |  +- org.apache.axis2:axis2-kernel:jar:1.7.9:compile
[INFO]    |  |  +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.21:compile
[INFO]    |  |  |  +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.1:compile
[INFO]    |  |  |  +- jaxen:jaxen:jar:1.2.0:compile
[INFO]    |  |  |  +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO]    |  |  |  \- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
[INFO]    |  |  +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.21:runtime
[INFO]    |  |  +- org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:jar:1.1.2:compile
[INFO]    |  |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1:compile
[INFO]    |  |  +- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO]    |  |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.1:compile
[INFO]    |  |  +- org.apache.neethi:neethi:jar:3.0.3:compile
[INFO]    |  |  \- org.apache.woden:woden-core:jar:1.0M10:compile
[INFO]    |  \- org.apache.axis2:axis2-transport-local:jar:1.7.9:runtime
[INFO]    +- com.sap.cloud.sdk.s4hana:rfc:jar:3.72.0:compile
[INFO]    \- com.sap.cloud.servicesdk:odatav2-connectivity-sdk3:jar:1.40.11:compile
[INFO]       +- com.sap.cloud.servicesdk:jacksonutil-sdk3:jar:1.40.11:compile
[INFO]       +- joda-time:joda-time:jar:2.9.9:compile
[INFO]       \- com.sap.cloud.servicesdk.prov:api:jar:1.40.11:compile
[INFO]          +- javax.transaction:javax.transaction-api:jar:1.3:compile
[INFO]          +- commons-beanutils:commons-beanutils:jar:1.9.4:compile
[INFO]          |  \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO]          \- com.sap.cds:cds4j-api:jar:1.13.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.908 s
[INFO] Finished at: 2023-05-25T17:44:37+05:30
[INFO] ------------------------------------------------------------------------

Accepted Solutions (0)

Answers (1)

Answers (1)

Slava
Advisor
Advisor
0 Kudos

The problem is obvious: you have two different logback-classic implementations in two different places: one is in the WEB-INF/lib and the other is in the META-INF. The latter is unconventional. Typically, maven places dependencies from your pom file into WEB-INF lib. Check you build process (maven configuration) if there is anything that places the lib into the META-INF. But most likely, that the jar file is checked in in your git repository inside the META-INF directory. If so, delete that file.