I am working on a Play 2.2 application, and everything went a bit on me since I was trying to add my DB level.
Below are my dependencies build.sbt. As you can see, I use mysql-connector-javaand play-slick:
libraryDependencies ++= Seq(
jdbc,
anorm,
cache,
"joda-time" % "joda-time" % "2.3",
"mysql" % "mysql-connector-java" % "5.1.26",
"com.typesafe.play" %% "play-slick" % "0.5.0.8",
"com.aetrion.flickr" % "flickrapi" % "1.1"
)
There application.confare several similar DB things in mine :
db.default.url="jdbc:mysql://localhost/myDb"
db.default.driver="com.mysql.jdbc.Driver"
db.default.user="root"
db.default.pass=""
Here's what it looks like when you start the Play server:
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
[info] Compiling 1 Scala source to C:\bbq\cats\in\space
[info] play - database [default] connected at jdbc:mysql://localhost/myDb
[info] play - Application started (Dev)
So, it looks like Play can connect to the MySQL database just fine (I think). However, I get this exception when I make a request to my server:
[error] p.nettyException - Exception caught in Netty
java.lang.NoSuchMethodError: akka.actor.ActorSystem.dispatcher()Lscala/concurren
t/ExecutionContext;
at play.core.Invoker$.<init>(Invoker.scala:24) ~[play_2.10.jar:2.2.0]
at play.core.Invoker$.<clinit>(Invoker.scala) ~[play_2.10.jar:2.2.0]
at play.api.libs.concurrent.Execution$Implicits$.defaultContext$lzycompu
te(Execution.scala:7) ~[play_2.10.jar:2.2.0]
at play.api.libs.concurrent.Execution$Implicits$.defaultContext(Executio
n.scala:6) ~[play_2.10.jar:2.2.0]
at play.api.libs.concurrent.Execution$.<init>(Execution.scala:10) ~[play
_2.10.jar:2.2.0]
at play.api.libs.concurrent.Execution$.<clinit>(Execution.scala) ~[play_
2.10.jar:2.2.0]
It is odd that the second request (to the same URL, to one controller, without changes) returns with a different error:
[error] p.nettyException - Exception caught in Netty
java.lang.NoClassDefFoundError: Could not initialize class play.api.libs.concurr
ent.Execution$
at play.core.server.netty.PlayDefaultUpstreamHandler.handleAction$1(Play
DefaultUpstreamHandler.scala:194) ~[play_2.10.jar:2.2.0]
at play.core.server.netty.PlayDefaultUpstreamHandler.messageReceived(Pla
yDefaultUpstreamHandler.scala:169) ~[play_2.10.jar:2.2.0]
at com.typesafe.netty.http.pipelining.HttpPipeliningHandler.messageRecei
ved(HttpPipeliningHandler.java:62) ~[netty-http-pipelining.jar:na]
at org.jboss.netty.handler.codec.http.HttpContentDecoder.messageReceived
(HttpContentDecoder.java:108) ~[netty-3.6.5.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:29
6) ~[netty-3.6.5.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessage
Received(FrameDecoder.java:459) ~[netty-3.6.5.Final.jar:na]
URL/, , - . , . . , .
Scala 2.10.2, Play 2.2.0 MySQL Server 5.6.14.0 (Community Edition).