user2009490
user2009490

Reputation: 348

Failed to instantiate SLF4J LoggerFactory, Scala, IDEA

When I write following string

val mongoClient =  MongoClient("172.27.80.111", 42017)

I have got Error

Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/slf4j/spi/LoggerFactoryBinder

File slf4j-log4j12-1.7.5.jar I copied to C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext.

How I can fix this?

Upvotes: 0

Views: 1774

Answers (1)

johanandren
johanandren

Reputation: 11479

Try putting slf4j-log4j12-1.7.5.jar in lib/ in your project instead? Or even better put a dependency on it in project/Build.scala like this:

val appDependencies = Seq(
  // Add your project dependencies here,
  "org.slf4j" % "slf4j-log4j12" % "1.7.5"
)

Upvotes: 1

Related Questions