netty冲突 play sbt_scala – java.lang.ClassNotFoundException:play.core.server.NettyServer,当更多播放库添加到buil...

我是

Scala,SBT和Play的新手,所以请将其视为NooB questtion.我正在为竞赛构建一个示例Play应用程序,并以reactive-stocks应用程序作为模板开始.为了自然地扩展其功能,我需要添加安全性,JDBC连接等.

这是模板中提供的原始build.sbt文件 –

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(

ws, // Play's web services module

"com.typesafe.akka" %% "akka-actor" % "2.3.4",

"com.typesafe.akka" %% "akka-slf4j" % "2.3.4",

"org.webjars" % "bootstrap" % "2.3.1",

"org.webjars" % "flot" % "0.8.0",

"com.typesafe.akka" %% "akka-testkit" % "2.3.4" % "test"

)

在此我将“com.typesafe.play”%“anorm_2.11”%“2.4.0-M1”添加到slf4j依赖项之后的列表中,并且应用程序能够编译并运行.

现在,如果我添加任何“com.typesafe.play”%“filters-helpers_2.11”%“2.4.0-M1”或“com.typesafe.play”%“play-jdbc_2.11”%“2.4.0 -M1\”

播放应用程序无法在Activator web ui中编译,消息为“(echo:run)java.lang.ClassNotFoundException:play.core.server.NettyServer”.

Netty Server类肯定在类路径中.那有什么问题呢?

我正在使用JDK 8.失败的配置是

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(

ws, // Play's web services module

"com.typesafe.akka" %% "akka-actor" % "2.3.4",

"com.typesafe.akka" %% "akka-slf4j" % "2.3.4",

"org.webjars" % "bootstrap" % "2.3.1",

"org.webjars" % "flot" % "0.8.0",

"com.typesafe.akka" %% "akka-testkit" % "2.3.4" % "test",

"com.typesafe.play" % "anorm_2.11" % "2.4.0-M1",

"com.typesafe.play" % "filters-helpers_2.11" % "2.4.0-M1",

"com.typesafe.play" % "play-jdbc_2.11" % "2.4.0-M1"

)

与日志

Reapplying settings...

Set current project to reactive-stocks (in build file:/D:/Miura/reactive-stocks/)

Reapplying settings...

Set current project to reactive-stocks (in build file:/D:/Miura/reactive-stocks/)

Reapplying settings...

Set current project to reactive-stocks (in build file:/D:/Miura/reactive-stocks/)

Reapplying settings...

Set current project to reactive-stocks (in build file:/D:/Miura/reactive-stocks/)

Running task... Cancel: sbt.TaskCancellationStrategy$Null$@571cf19b, check cycles: false

play.core.server.NettyServer

(echo:run) java.lang.ClassNotFoundException: play.core.server.NettyServer

Run complete.

最佳答案 正如在

Google group上回答的那样,问题在于混合了Play库版本.股票模板适用于Play 2.3.3,但我试图添加的库是2.4.

build.sbt中的此配置有效

libraryDependencies ++= Seq(

jdbc,

anorm,

cache,

ws

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值