Strange Play Framework 2.2 exceptions after trying to add MySQL / slick

Posted by Mike Cialowicz on Stack Overflow See other posts from Stack Overflow or by Mike Cialowicz
Published on 2013-10-16T06:55:02Z Indexed on 2013/10/18 3:54 UTC
Read the original article Hit count: 838

I'm working on a Play 2.2 application, and things have gone a bit south on me since I've tried adding my DB layer.

Below are my build.sbt dependencies. As you can see I use mysql-connector-java and 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"
)

My application.conf has some similarly simple DB stuff in it:

db.default.url="jdbc:mysql://localhost/myDb"
db.default.driver="com.mysql.jdbc.Driver"
db.default.user="root"
db.default.pass=""

This is what it looks like when my Play server starts:

[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 appears that Play can connect to the MySQL DB just fine (I think). However, I get this exception when I make any 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]

The odd thing is that the 2nd request (to the exact same URL, same controller, no changes) comes back 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]

The URL / controller that I'm requesting just renders a static web page and doesn't do anything of any significance. It was working just fine before I started adding my DB layer. I'm rather stuck. Any help would be greatly appreciated, thanks.

I'm using Scala 2.10.2, Play 2.2.0, and MySQL Server 5.6.14.0 (community edition).

© Stack Overflow or respective owner

Related posts about mysql

Related posts about scala