Giter VIP home page Giter VIP logo

Comments (18)

barbetb avatar barbetb commented on June 9, 2024 1

Sure, let's call, my discord is [removed]

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

Well the only change I introduced with LogCapter v2.8.0 was bumping some transitive dependencies to their latest version. So I am assuming that in your project the version of logback-classic and/or slf4j is not correct anymore.

Can you run a dependency tree and tell me which version of logback classic and slf4j is on your class path?

The root cause of this issue is mostly duo other libraries providing a different version of those transitieve depenencies

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

Can you run a dependency tree and tell me which version of logback classic and slf4j is on your class path?

Hi @barbetb any updates from your side?

from log-captor.

barbetb avatar barbetb commented on June 9, 2024

the full tree:

[INFO] ---------------< nl.mycorp.online.mydep.reqresp:client >---------------
[INFO] Building client 0.0.3-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ client ---
[INFO] nl.mycorp.online.mydep.reqresp:client:jar:0.0.3-SNAPSHOT
[INFO] +- nl.mycorp.online.mydep.reqresp:common:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- org.springframework.boot:spring-boot-configuration-processor:jar:2.7.8:compile
[INFO] |  +- com.nimbusds:nimbus-jose-jwt:jar:9.30.1:compile
[INFO] |  |  \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] |  +- org.bouncycastle:bc-fips:jar:1.0.2.3:compile
[INFO] |  \- org.bouncycastle:bcpkix-fips:jar:1.0.7:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:generated-client:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- io.swagger:swagger-annotations:jar:1.6.6:compile
[INFO] |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  +- com.squareup.okhttp3:okhttp:jar:4.10.0:compile
[INFO] |  |  +- com.squareup.okio:okio-jvm:jar:3.0.0:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.5.31:compile
[INFO] |  |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.20:compile
[INFO] |  |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  +- com.squareup.okhttp3:logging-interceptor:jar:4.10.0:compile
[INFO] |  |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.10:compile
[INFO] |  |     \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.6.10:compile
[INFO] |  +- io.gsonfire:gson-fire:jar:1.8.5:compile
[INFO] |  +- org.threeten:threetenbp:jar:1.6.0:compile
[INFO] |  \- junit:junit:jar:4.13.2:compile
[INFO] |     \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:common:test-jar:tests:0.0.3-SNAPSHOT:test
[INFO] +- nl.mycorp.online.mydep:mydep-okhttp-client:jar:master_20230214.1_abfb7a14:compile
[INFO] |  +- com.squareup.okhttp3:okhttp-tls:jar:4.10.0:compile
[INFO] |  +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] |  |  \- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  +- com.google.guava:guava:jar:31.1-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] |  |  +- org.checkerframework:checker-qual:jar:3.12.0:compile
[INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.11.0:compile
[INFO] |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  \- io.github.resilience4j:resilience4j-circuitbreaker:jar:1.7.1:compile
[INFO] |     +- io.vavr:vavr:jar:0.10.2:compile
[INFO] |     |  \- io.vavr:vavr-match:jar:0.10.2:compile
[INFO] |     \- io.github.resilience4j:resilience4j-core:jar:1.7.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.7.8:compile
[INFO] |  |  \- org.springframework:spring-context:jar:5.3.25:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.8:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  +- org.springframework:spring-core:jar:5.3.25:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.25:compile
[INFO] |  \- org.yaml:snakeyaml:jar:1.30:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.8:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.7.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.8:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.8:test
[INFO] |  |        \- org.ow2.asm:asm:jar:9.1: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.22.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.9.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.9.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.9.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.9.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.9.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.9.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.12.9:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.9:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.25:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.7.8:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.8:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.71:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.71:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.71:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.25:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.3.25:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.25:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.3.25:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.25:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.26:compile
[INFO] +- com.google.code.gson:gson:jar:2.10.1:compile
[INFO] +- io.github.hakky54:logcaptor:jar:2.8.0:test
[INFO] |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.19.0:compile
[INFO] |  |  \- org.apache.logging.log4j:log4j-api:jar:2.19.0:compile
[INFO] |  \- org.slf4j:jul-to-slf4j:jar:2.0.6:compile
[INFO] \- ch.qos.logback:logback-classic:jar:1.3.5:test
[INFO]    +- ch.qos.logback:logback-core:jar:1.3.5:test
[INFO]    \- org.slf4j:slf4j-api:jar:1.7.36:compile

I see it would pick up the logback from the log-captor library: ch.qos.logback:logback-core:jar:1.3.5:compile
but i have added it explicitly as well.

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

I see the issue related to mismatch of version. Somehow your project is using the older version of SLF4J.

LogCaptor is configured with logback-classic version 1.3.5 which is using sl4fj-api with version 2.0.4. An older version of sfl4j-api will not work. In your project version 1.7.36 is being used and therefor it is failing and that explain your situation. Although LogCaptor is being configured and shipped with slf4j-api version 2.0.4 it is being overruled by another dependency which is also providing slf4j-api which has an older version or your project is configured with an older version of slf4j-api.

The solution which I would suggest for your use case would be adding the following section to your pom:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.6</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

For logback classic you can either use version 1.3.x or 1.4.x as it does not matter. Version 1.3.x is compatible with java 8 and newer and version 1.4.x is compatible with java 11 and newer. If you are using java 11 or newer and also using jakarte packages I would suggest to use logback-classic version 1.4.x or else keep it as is.

Can you retry with the dependencymanagement configuration for slf4j-api in your pom and retry whether it is working for you?

from log-captor.

barbetb avatar barbetb commented on June 9, 2024

So, I upgrade to slf4j-api to version 2.0.4 . This fixed the unit tests. However now my integration test module is failing:
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
So logback classic logbinder needs to be included? Where do I find that?

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

Okay, we are making progress, it looks like we are almost there. What is your dependency tree right now? hopefully it will give us more insight about why your integration test is failing

from log-captor.

barbetb avatar barbetb commented on June 9, 2024
[INFO] ------------< nl.mycorp.online.mydep.reqresp:integration >-------------
[INFO] Building integration 0.0.3-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ integration ---
[INFO] nl.mycorp.online.mydep.reqresp:integration:jar:0.0.3-SNAPSHOT
[INFO] +- nl.mycorp.online.mydep.reqresp:host:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:common:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:generated-host:jar:0.0.3-SNAPSHOT:compile
[INFO] |  |  +- org.springframework:spring-context:jar:5.3.20:compile
[INFO] |  |  +- io.swagger:swagger-annotations:jar:1.6.6:compile
[INFO] |  |  +- io.springfox:springfox-swagger2:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-spi:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.springfox:springfox-core:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-schema:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-swagger-common:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.swagger.core.v3:swagger-annotations:jar:2.1.2:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-web:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.github.classgraph:classgraph:jar:4.8.83:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-webmvc:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-webflux:jar:3.0.0:compile
[INFO] |  |  |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  |  |  +- org.springframework.plugin:spring-plugin-core:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.plugin:spring-plugin-metadata:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- io.swagger:swagger-models:jar:1.5.20:compile
[INFO] |  |  |  \- org.mapstruct:mapstruct:jar:1.3.1.Final:runtime
[INFO] |  |  +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.openapitools:jackson-databind-nullable:jar:0.2.3:compile
[INFO] |  +- com.nimbusds:nimbus-jose-jwt:jar:9.30.1:compile
[INFO] |  |  \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] |  +- org.bouncycastle:bc-fips:jar:1.0.2.3:compile
[INFO] |  \- org.bouncycastle:bcpkix-fips:jar:1.0.7:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:client:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:generated-client:jar:0.0.3-SNAPSHOT:compile
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |  +- com.squareup.okhttp3:okhttp:jar:4.10.0:compile
[INFO] |  |  |  +- com.squareup.okio:okio-jvm:jar:3.0.0:compile
[INFO] |  |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.5.31:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.20:compile
[INFO] |  |  |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  |  +- com.squareup.okhttp3:logging-interceptor:jar:4.10.0:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.10:compile
[INFO] |  |  |     \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.6.10:compile
[INFO] |  |  +- io.gsonfire:gson-fire:jar:1.8.5:compile
[INFO] |  |  +- org.threeten:threetenbp:jar:1.6.0:compile
[INFO] |  |  \- junit:junit:jar:4.13.2:compile
[INFO] |  |     \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] |  +- nl.mycorp.online.mydep:mydep-okhttp-client:jar:master_20230214.1_abfb7a14:compile
[INFO] |  |  +- com.squareup.okhttp3:okhttp-tls:jar:4.10.0:compile
[INFO] |  |  +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] |  |  |  \- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  |  +- com.google.guava:guava:jar:31.1-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] |  |  |  +- org.checkerframework:checker-qual:jar:3.12.0:compile
[INFO] |  |  |  +- com.google.errorprone:error_prone_annotations:jar:2.11.0:compile
[INFO] |  |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  |  \- io.github.resilience4j:resilience4j-circuitbreaker:jar:1.7.1:compile
[INFO] |  |     +- io.vavr:vavr:jar:0.10.2:compile
[INFO] |  |     |  \- io.vavr:vavr-match:jar:0.10.2:compile
[INFO] |  |     \- io.github.resilience4j:resilience4j-core:jar:1.7.1:compile
[INFO] |  \- com.google.code.gson:gson:jar:2.10.1:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:common:test-jar:tests:0.0.3-SNAPSHOT:test
[INFO] |  \- org.springframework.boot:spring-boot-configuration-processor:jar:2.7.8:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.7.8:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-actuator:jar:2.7.8:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.4:compile
[INFO] |  \- io.micrometer:micrometer-core:jar:1.9.7:compile
[INFO] |     +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] |     \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.8:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  \- org.springframework:spring-core:jar:5.3.25:compile
[INFO] |     \- org.springframework:spring-jcl:jar:5.3.25:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.8:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.7.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.8:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.8:test
[INFO] |  |        \- org.ow2.asm:asm:jar:9.1: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.22.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.9.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.9.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.9.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.9.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.9.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.9.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.12.9:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.9:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.25:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.7.8:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.8:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.71:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.71:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.71:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.25:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.3.25:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.25:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.3.25:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.25:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.26:compile
[INFO] +- org.yaml:snakeyaml:jar:1.30:compile
[INFO] +- io.github.hakky54:logcaptor:jar:2.8.0:test
[INFO] |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.19.0:compile
[INFO] |  |  \- org.apache.logging.log4j:log4j-api:jar:2.19.0:compile
[INFO] |  \- org.slf4j:jul-to-slf4j:jar:2.0.6:compile
[INFO] \- ch.qos.logback:logback-classic:jar:1.3.5:test
[INFO]    +- ch.qos.logback:logback-core:jar:1.3.5:test
[INFO]    \- org.slf4j:slf4j-api:jar:2.0.4:compile

This is my current tree for integration test

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

So it seems like your project is depending on org.springframework.boot:spring-boot-starter-logging:jar:2.7.8 which is ok, however it is using slf4j-api version 1.7.x and logback-classic version 1.2.x which are both incompatible with the latest version of LogCaptor.

So we can do 2 things: exclude some transitive dependencies from org.springframework.boot:spring-boot-starter-logging and add the required dependencies explicitly on your pom or have additional configuration in your dependency management.

I think the second option is better as it designed to resolve these kind of issues. So I would suggest you to have the following snippet in your dependency management:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>2.0.6</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.3.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-to-slf4j</artifactId>
            <version>2.19.0</version>
        </dependency>
    </dependencies>
</dependencyManagement>

The transitive dependencies of org.springframework.boot:spring-boot-starter-logging can also be viewed here: https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-logging/2.7.8 We have now explicitly configured to use certain versions of dependencies, so if other dependencies rely on any of these then they are forced to use that version. All of the versions of the dependencies in the dependency management sections are compatible with eachother. Can you retry with that snippet? I am curious whether it will work for you.

from log-captor.

barbetb avatar barbetb commented on June 9, 2024

no same issue remains, this is the new tree with your suggestion included:

[INFO] ------------< nl.mycorp.online.mydep.reqresp:integration >-------------
[INFO] Building integration 0.0.3-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ integration ---
[INFO] nl.mycorp.online.mydep.reqresp:integration:jar:0.0.3-SNAPSHOT
[INFO] +- nl.mycorp.online.mydep.reqresp:host:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:common:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:generated-host:jar:0.0.3-SNAPSHOT:compile
[INFO] |  |  +- org.springframework:spring-context:jar:5.3.20:compile
[INFO] |  |  +- io.swagger:swagger-annotations:jar:1.6.6:compile
[INFO] |  |  +- io.springfox:springfox-swagger2:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-spi:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.springfox:springfox-core:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-schema:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-swagger-common:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.swagger.core.v3:swagger-annotations:jar:2.1.2:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-web:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.github.classgraph:classgraph:jar:4.8.83:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-webmvc:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-webflux:jar:3.0.0:compile
[INFO] |  |  |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  |  |  +- org.springframework.plugin:spring-plugin-core:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.plugin:spring-plugin-metadata:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- io.swagger:swagger-models:jar:1.5.20:compile
[INFO] |  |  |  \- org.mapstruct:mapstruct:jar:1.3.1.Final:runtime
[INFO] |  |  +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.openapitools:jackson-databind-nullable:jar:0.2.3:compile
[INFO] |  +- com.nimbusds:nimbus-jose-jwt:jar:9.30.1:compile
[INFO] |  |  \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] |  +- org.bouncycastle:bc-fips:jar:1.0.2.3:compile
[INFO] |  \- org.bouncycastle:bcpkix-fips:jar:1.0.7:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:client:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:generated-client:jar:0.0.3-SNAPSHOT:compile
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |  +- com.squareup.okhttp3:okhttp:jar:4.10.0:compile
[INFO] |  |  |  +- com.squareup.okio:okio-jvm:jar:3.0.0:compile
[INFO] |  |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.5.31:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.20:compile
[INFO] |  |  |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  |  +- com.squareup.okhttp3:logging-interceptor:jar:4.10.0:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.10:compile
[INFO] |  |  |     \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.6.10:compile
[INFO] |  |  +- io.gsonfire:gson-fire:jar:1.8.5:compile
[INFO] |  |  +- org.threeten:threetenbp:jar:1.6.0:compile
[INFO] |  |  \- junit:junit:jar:4.13.2:compile
[INFO] |  |     \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] |  +- nl.mycorp.online.mydep:mydep-okhttp-client:jar:master_20230214.1_abfb7a14:compile
[INFO] |  |  +- com.squareup.okhttp3:okhttp-tls:jar:4.10.0:compile
[INFO] |  |  +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] |  |  |  \- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  |  +- com.google.guava:guava:jar:31.1-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] |  |  |  +- org.checkerframework:checker-qual:jar:3.12.0:compile
[INFO] |  |  |  +- com.google.errorprone:error_prone_annotations:jar:2.11.0:compile
[INFO] |  |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  |  \- io.github.resilience4j:resilience4j-circuitbreaker:jar:1.7.1:compile
[INFO] |  |     +- io.vavr:vavr:jar:0.10.2:compile
[INFO] |  |     |  \- io.vavr:vavr-match:jar:0.10.2:compile
[INFO] |  |     \- io.github.resilience4j:resilience4j-core:jar:1.7.1:compile
[INFO] |  \- com.google.code.gson:gson:jar:2.10.1:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:common:test-jar:tests:0.0.3-SNAPSHOT:test
[INFO] |  \- org.springframework.boot:spring-boot-configuration-processor:jar:2.7.8:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.7.8:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-actuator:jar:2.7.8:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.4:compile
[INFO] |  \- io.micrometer:micrometer-core:jar:1.9.7:compile
[INFO] |     +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] |     \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.8:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  \- org.springframework:spring-core:jar:5.3.25:compile
[INFO] |     \- org.springframework:spring-jcl:jar:5.3.25:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.8:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.7.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.8:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.8:test
[INFO] |  |        \- org.ow2.asm:asm:jar:9.1: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.22.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.9.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.9.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.9.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.9.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.9.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.9.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.12.9:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.9:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.25:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.7.8:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.8:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.71:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.71:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.71:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.25:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.3.25:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.25:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.3.25:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.25:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.26:compile
[INFO] +- org.yaml:snakeyaml:jar:1.30:compile
[INFO] +- io.github.hakky54:logcaptor:jar:2.8.0:test
[INFO] +- ch.qos.logback:logback-classic:jar:1.3.5:test
[INFO] |  \- ch.qos.logback:logback-core:jar:1.3.5:test
[INFO] +- org.slf4j:slf4j-api:jar:2.0.6:compile
[INFO] +- org.slf4j:jul-to-slf4j:jar:2.0.6:compile
[INFO] \- org.apache.logging.log4j:log4j-to-slf4j:jar:2.19.0:compile
[INFO]    \- org.apache.logging.log4j:log4j-api:jar:2.19.0:compile

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

Hmm, this is strange. slf4j-api requires an implementation and you have it as you are using logback-classic, so it should not give you that error. Can you try to add the following dependency:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>2.0.6</version>
</dependency>

from log-captor.

barbetb avatar barbetb commented on June 9, 2024

nope, did din't fix it unfortunately. Same error still. New tree

[INFO] ------------< nl.mycorp.online.mydep.reqresp:integration >-------------
[INFO] Building integration 0.0.3-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ integration ---
[INFO] nl.mycorp.online.mydep.reqresp:integration:jar:0.0.3-SNAPSHOT
[INFO] +- nl.mycorp.online.mydep.reqresp:host:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:common:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:generated-host:jar:0.0.3-SNAPSHOT:compile
[INFO] |  |  +- org.springframework:spring-context:jar:5.3.20:compile
[INFO] |  |  +- io.swagger:swagger-annotations:jar:1.6.6:compile
[INFO] |  |  +- io.springfox:springfox-swagger2:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-spi:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.springfox:springfox-core:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-schema:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-swagger-common:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.swagger.core.v3:swagger-annotations:jar:2.1.2:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-web:jar:3.0.0:compile
[INFO] |  |  |  |  \- io.github.classgraph:classgraph:jar:4.8.83:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-webmvc:jar:3.0.0:compile
[INFO] |  |  |  +- io.springfox:springfox-spring-webflux:jar:3.0.0:compile
[INFO] |  |  |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  |  |  +- org.springframework.plugin:spring-plugin-core:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.plugin:spring-plugin-metadata:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  +- io.swagger:swagger-models:jar:1.5.20:compile
[INFO] |  |  |  \- org.mapstruct:mapstruct:jar:1.3.1.Final:runtime
[INFO] |  |  +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.openapitools:jackson-databind-nullable:jar:0.2.3:compile
[INFO] |  +- com.nimbusds:nimbus-jose-jwt:jar:9.30.1:compile
[INFO] |  |  \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] |  +- org.bouncycastle:bc-fips:jar:1.0.2.3:compile
[INFO] |  \- org.bouncycastle:bcpkix-fips:jar:1.0.7:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:client:jar:0.0.3-SNAPSHOT:compile
[INFO] |  +- nl.mycorp.online.mydep.reqresp:generated-client:jar:0.0.3-SNAPSHOT:compile
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |  +- com.squareup.okhttp3:okhttp:jar:4.10.0:compile
[INFO] |  |  |  +- com.squareup.okio:okio-jvm:jar:3.0.0:compile
[INFO] |  |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.5.31:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.20:compile
[INFO] |  |  |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  |  +- com.squareup.okhttp3:logging-interceptor:jar:4.10.0:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.10:compile
[INFO] |  |  |     \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.6.10:compile
[INFO] |  |  +- io.gsonfire:gson-fire:jar:1.8.5:compile
[INFO] |  |  +- org.threeten:threetenbp:jar:1.6.0:compile
[INFO] |  |  \- junit:junit:jar:4.13.2:compile
[INFO] |  |     \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] |  +- nl.mycorp.online.mydep:mydep-okhttp-client:jar:master_20230214.1_abfb7a14:compile
[INFO] |  |  +- com.squareup.okhttp3:okhttp-tls:jar:4.10.0:compile
[INFO] |  |  +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] |  |  |  \- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  |  +- com.google.guava:guava:jar:31.1-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] |  |  |  +- org.checkerframework:checker-qual:jar:3.12.0:compile
[INFO] |  |  |  +- com.google.errorprone:error_prone_annotations:jar:2.11.0:compile
[INFO] |  |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  |  \- io.github.resilience4j:resilience4j-circuitbreaker:jar:1.7.1:compile
[INFO] |  |     +- io.vavr:vavr:jar:0.10.2:compile
[INFO] |  |     |  \- io.vavr:vavr-match:jar:0.10.2:compile
[INFO] |  |     \- io.github.resilience4j:resilience4j-core:jar:1.7.1:compile
[INFO] |  \- com.google.code.gson:gson:jar:2.10.1:compile
[INFO] +- nl.mycorp.online.mydep.reqresp:common:test-jar:tests:0.0.3-SNAPSHOT:test
[INFO] |  \- org.springframework.boot:spring-boot-configuration-processor:jar:2.7.8:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.7.8:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-actuator:jar:2.7.8:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.4:compile
[INFO] |  \- io.micrometer:micrometer-core:jar:1.9.7:compile
[INFO] |     +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] |     \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.8:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  \- org.springframework:spring-core:jar:5.3.25:compile
[INFO] |     \- org.springframework:spring-jcl:jar:5.3.25:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.7.8:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.8:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.7.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.8:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.8:test
[INFO] |  |        \- org.ow2.asm:asm:jar:9.1: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.22.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.9.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.9.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.9.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.9.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.9.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.9.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.12.9:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.9:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.25:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.7.8:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.8:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.71:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.71:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.71:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.25:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.3.25:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.25:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.3.25:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.25:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.26:compile
[INFO] +- org.yaml:snakeyaml:jar:1.30:compile
[INFO] +- io.github.hakky54:logcaptor:jar:2.8.0:test
[INFO] +- ch.qos.logback:logback-classic:jar:1.3.5:test
[INFO] |  \- ch.qos.logback:logback-core:jar:1.3.5:test
[INFO] +- org.slf4j:slf4j-api:jar:2.0.6:compile
[INFO] +- org.slf4j:jul-to-slf4j:jar:2.0.6:compile
[INFO] +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.19.0:compile
[INFO] |  \- org.apache.logging.log4j:log4j-api:jar:2.19.0:compile
[INFO] \- org.slf4j:slf4j-simple:jar:2.0.6:compile

from log-captor.

barbetb avatar barbetb commented on June 9, 2024

I see indeed that java 11 would make life easier. Maybe in the future this project can go to java 11, but for now unfortunately it has to stay on 8 :(.

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

Staying on java 8 is fine, it should not be an issue for me at least when using it alongside LogCaptor because it is compatible.

Lets try something else. You can remove slf4j-simple. And next to that can you adjust your dependencymanagement to:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.6</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>2.0.6</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.3.5</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-to-slf4j</artifactId>
            <version>2.19.0</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

I added here the dependency scope of compile time. Lets see if this will work

from log-captor.

barbetb avatar barbetb commented on June 9, 2024

No, I also removed some test scopes on some of the dependencies. Nothing changed. Seems that the binder cannot be found for some reason.

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

Really strange, I am out of options but I still want to help you. Would you like to do have a online meeting so we can debug this issue together? I need to have a look at the whole project configuration as something is messing up your logging configuration. I am using discord and I can assist you from there if you want.

from log-captor.

barbetb avatar barbetb commented on June 9, 2024

Unfortunately we could not resolve this issue.

Current full stack trace:

    14:59:17.904 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
    14:59:17.934 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
    14:59:18.022 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
    14:59:18.046 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest], using SpringBootContextLoader
    14:59:18.060 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest]: class path resource [nl/mycorp/online/mydep/reqresp/integration/IT/EncryptionIntegrationTest-context.xml] does not exist
    14:59:18.061 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest]: class path resource [nl/mycorp/online/mydep/reqresp/integration/IT/EncryptionIntegrationTestContext.groovy] does not exist
    14:59:18.062 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest]: no resource found for suffixes {-context.xml, Context.groovy}.
    14:59:18.083 [main] DEBUG org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Ignoring class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest$Encryptor]; it must be static, non-private, non-final, and annotated with @Configuration to be considered a default configuration class.
    14:59:18.084 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest]: EncryptionIntegrationTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
    14:59:18.464 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [/Users/riekele/dev/ideaProjects/mydep-request-response-signing/test/integration/target/classes/nl/mycorp/online/mydep/reqresp/integration/TestApplication.class]
    14:59:18.466 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration nl.mycorp.online.mydep.reqresp.integration.TestApplication for test class nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest
    14:59:18.634 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest]: using defaults.
    14:59:18.635 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
    14:59:18.656 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener] due to a missing dependency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [org/springframework/transaction/TransactionDefinition]
    14:59:18.657 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] due to a missing dependency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [org/springframework/transaction/interceptor/TransactionAttribute]
    14:59:18.658 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@64ec96c6, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@77659b30, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@456d6c1e, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@1e13529a, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@1ec9bd38, org.springframework.test.context.support.DirtiesContextTestExecutionListener@452e19ca, org.springframework.test.context.event.EventPublishingTestExecutionListener@6b0d80ed, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@6f8e8894, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@3cfdd820, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@928763c, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@e25951c, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@15f47664, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@471a9022]
    14:59:18.665 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@102cec62 testClass = EncryptionIntegrationTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@74f6c5d8 testClass = EncryptionIntegrationTest, locations = '{}', classes = '{class nl.mycorp.online.mydep.reqresp.integration.TestApplication}', contextInitializerClasses = '[]', activeProfiles = '{encrypt}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@27912e3 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration, org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration, org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityConfiguration, org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@37f1104d, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@65b3f4a4, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@6333a8f4, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@2e1d27ba, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@776b83cc, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@4b3fa0b3, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@865dd6, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@5ba23b66], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> false]], class annotated with @DirtiesContext [true] with mode [AFTER_CLASS].
    14:59:18.782 [main] ERROR org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@1e13529a] to prepare test instance [nl.mycorp.online.mydep.reqresp.integration.IT.EncryptionIntegrationTest@4397ad89]
    java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
    at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:293)
    at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:118)
    at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:238)
    at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:220)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
    at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:79)
    at org.springframework.boot.SpringApplicationRunListeners.lambda$starting$0(SpringApplicationRunListeners.java:56)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
    at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:56)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:298)
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:136)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
    at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.postProcessFields(MockitoTestExecutionListener.java:110)
    at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.injectFields(MockitoTestExecutionListener.java:94)
    at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.prepareTestInstance(MockitoTestExecutionListener.java:61)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:248)
    at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278)
    at java.util.Optional.orElseGet(Optional.java:267)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277)
    at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
    Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
    ... 90 common frames omitted

    java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

    at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:293)
    at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:118)
    at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:238)
    at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:220)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
    at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:79)
    at org.springframework.boot.SpringApplicationRunListeners.lambda$starting$0(SpringApplicationRunListeners.java:56)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
    at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:56)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:298)
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:136)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
    at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.postProcessFields(MockitoTestExecutionListener.java:110)
    at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.injectFields(MockitoTestExecutionListener.java:94)
    at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.prepareTestInstance(MockitoTestExecutionListener.java:61)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:248)
    at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278)
    at java.util.Optional.orElseGet(Optional.java:267)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277)
    at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
    Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
    ... 90 more

    14:59:18.806 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - After test class: context [DefaultTestContext@102cec62 testClass = EncryptionIntegrationTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@74f6c5d8 testClass = EncryptionIntegrationTest, locations = '{}', classes = '{class nl.mycorp.online.mydep.reqresp.integration.TestApplication}', contextInitializerClasses = '[]', activeProfiles = '{encrypt}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@27912e3 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration, org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration, org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityConfiguration, org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@37f1104d, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@65b3f4a4, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@6333a8f4, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@2e1d27ba, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@776b83cc, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@4b3fa0b3, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@865dd6, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@5ba23b66], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> false, 'org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]], class annotated with @DirtiesContext [true] with mode [AFTER_CLASS].

    Process finished with exit code 255

from log-captor.

Hakky54 avatar Hakky54 commented on June 9, 2024

We did a video call with @barbetb and the issue is related to spring-boot . The org.springframework.boot:spring-boot-starter-logging library is invoking a class which is not present in the latest version of slf4j, see here for the specific invocation: https://github.com/spring-projects/spring-boot/blob/1ea70d3ddd24734ba1a85087ee70fc2b7f2273cf/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java#L293 . That specific class is not present anymore in the latest version of slf4j, so that explains the exception. See also here for the change they made for spring 3.x.x https://github.com/spring-projects/spring-boot/blob/ffedb26e9120ffbee588f859fe161b03399b4efe/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java#L373

I can suggest any of the following option to make it working:

  • Use the latest spring version (3.x.x) if you don't require java 8. Spring version (3.x.x) is compatible with slf4j 2.x.x
  • If you do need to stay on java 8 use spring 2.x.x and use logcaptor 2.7.x
  • Last option would be excluding org.springframework.boot:spring-boot-starter-logging from org.springframework.boot:spring-boot-starter and add slf4j 2.x.x and logback-classic 1.3.x to your pom.

I am closing this issue as it is not LogCaptor related and also not resolvable by the logcaptor library itself. I think the spring maintainers should make org.springframework.boot:spring-boot-starter-logging comptable with slf4j version 1 and 2.

Thank you @barbetb for opening this issue. Hopefully it will be usefull for others who encounter similar issues.

from log-captor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.