我一直在尝试让 SORM 与 Play Framework 2.2-SNAPSHOT 以及 2.1.1 一起使用。目前,我正在尝试运行我创建的简约示例应用程序,以便更轻松地跟踪问题。不幸的是,我收到的错误消息根本没有帮助我。
val appDependencies = Seq(
"org.sorm-framework" % "sorm" % "0.3.8",
"com.h2database" % "h2" % "1.3.168"
)
# Database configuration
#
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=""
case class Car( brand: String, wheels: Int )
object Db extends Instance( Seq( Entity[Car]() ), "jdbc:h2:mem:play" )
object Application extends Controller {
def index = Action {
Db.query[Car].count()
Ok("hello wolrd")
}
}
此堆栈跟踪的结果:
play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.NoSuchMethodError: scala.reflect.internal.TreeInfo.firstArgument(Lscala/reflect/internal/Trees$Tree;)Lscala/reflect/internal/Trees$Tree;]]
at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.1]
at play.api.DefaultApplication.handleError(Application.scala:383) [play_2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$17$$anonfun$apply$24.apply(PlayDefaultUpstreamHandler.scala:326) [play_2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$17$$anonfun$apply$24.apply(PlayDefaultUpstreamHandler.scala:324) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
java.lang.RuntimeException: java.lang.NoSuchMethodError: scala.reflect.internal.TreeInfo.firstArgument(Lscala/reflect/internal/Trees$Tree;)Lscala/reflect/internal/Trees$Tree;
at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:222) ~[play_2.10.jar:2.1.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:109) ~[play_2.10.jar:2.1.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:109) ~[play_2.10.jar:2.1.1]
at play.utils.Threads$.withContextClassLoader(Threads.scala:18) ~[play_2.10.jar:2.1.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:108) ~[play_2.10.jar:2.1.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:106) ~[play_2.10.jar:2.1.1]
Caused by: java.lang.NoSuchMethodError: scala.reflect.internal.TreeInfo.firstArgument(Lscala/reflect/internal/Trees$Tree;)Lscala/reflect/internal/Trees$Tree;
at scala.tools.nsc.typechecker.Typers$Typer.parentTypes(Typers.scala:1550) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Namers$Namer.templateSig(Namers.scala:861) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1300) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1347) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:709) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:708) ~[scala-compiler.jar:na]