0

I am using SBT 1.5.2 in a Java Play framework project but whenever I run the play project i get an error:

java.lang.ClassCastException: org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext

It is caused by this dependency:

"io.swagger" % "swagger-codegen-cli" % "2.4.19"

Because removing it ( or adding % provided) resolves the error. However, I need the dependency.

I checked swagger-codegen-cli’s dependencies and it shows this in its POM

 <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j-version}</version>
    </dependency>

How to fix ithis? I tried changing the dependency to

"io.swagger" % "swagger-codegen-cli" % "2.4.19" exclude("org.slf4j", "slf4j-simple")

but that didnt work either.

Any help appreciated! Cheers.

JHuys
  • 33
  • 1
  • 6
  • Have you run `sbt dependencyBrowseTree` to check that `slf4j-simple` is not brought by another dependency as well? If so you can check https://stackoverflow.com/questions/25747900/is-there-a-simple-way-to-specify-a-global-dependency-exclude-in-sbt – Gaël J May 21 '21 at 10:27
  • Yes, the only dependency's I could find came from the play framework which is what I'm using – JHuys May 28 '21 at 07:58

0 Answers0