Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.
This repository was archived by the owner on Feb 16, 2021. It is now read-only.

java.lang.NoSuchMethodError caused by dependency conflicts of multiple versions of logback #272

@LeoAugust19

Description

@LeoAugust19

Hi, there are multiple versions of ch.qos.logback:logback-classic:jar in org.mayocat.platform:mayocat-platform-model:jar:0.30.1. Due to Maven version management, only ch.qos.logback:logback-core:jar:1.0.10 can be loaded and the other versions will be shadowed during the packaging process.

However, method <ch.qos.logback.core.util.Loader: java.util.Set getResourceOccurenceCount(java.lang.String,java.lang.ClassLoader)> only defined in the shadowed version ch.qos.logback:logback-core:jar:1.0.6. As a result, an exception will be thrown when your project referencing the missing method.

Dependency tree
org.mayocat.platform:mayocat-platform-model:jar:0.30.1
+- org.xwiki.commons:xwiki-commons-observation-api:jar:4.5.2:compile
+- com.yammer.dropwizard:dropwizard-core:jar:0.6.2:compile
| +- com.yammer.metrics:metrics-logback:jar:2.2.0:compile
| +- ch.qos.logback:logback-core:jar:1.0.10:compile
| +- (ch.qos.logback:logback-classic:jar:1.0.10:compile - omitted for conflict with 1.0.6)
| - com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.1.2:compile
| +- (com.fasterxml.jackson.core:jackson-core:jar:2.1.2:compile - omitted for conflict with 2.1.4)
| +- (com.fasterxml.jackson.core:jackson-databind:jar:2.1.2:compile - omitted for conflict with 2.1.4)
| - (joda-time:joda-time:jar:2.1:compile - omitted for conflict with 2.2)
+- ch.qos.logback:logback-classic:jar:1.0.6:compile
| +- (ch.qos.logback:logback-core:jar:1.0.6:compile - omitted for conflict with 1.0.10)
| - (org.slf4j:slf4j-api:jar:1.6.5:compile - omitted for conflict with 1.7.4)
- org.jmock:jmock:jar:2.6.0-RC2:compile
+- org.hamcrest:hamcrest-core:jar:1.3.RC2:compile
- org.hamcrest:hamcrest-library:jar:1.3.RC2:compile
- (org.hamcrest:hamcrest-core:jar:1.3.RC2:compile - omitted for duplicate)

Solution
Upgrade ch.qos.logback:logback-classic to version 1.0.10.

Do you need stack trace or test case to investigate this issue? I can try to provide you more information.

Thanks a lot.

Regards,
Leo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions