无法实例化SLF4J LoggerFactory,Scala,IDEA

时间:2013-08-28 00:50:00

标签: scala

当我写下面的字符串

val mongoClient =  MongoClient("172.27.80.111", 42017)

我有错误

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

文件slf4j-log4j12-1.7.5.jar我复制到C:\ Program Files \ Java \ jdk1.7.0_25 \ jre \ lib \ ext。

我如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

尝试将slf4j-log4j12-1.7.5.jar放入项目的lib/中吗?或者甚至更好地在project / Build.scala中依赖它:

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