Office of Secret Intelligence

Who taught you to be a spy, fucking Gallagher!?!

RE: Playing With Scala: Building a Small Web App with Play 2.4, Play-Slick and Postgres

Hi Devin,

I had a look at your build.sbt (here, and there are a couple of things you should change. First, remove the dependency to jdbc module. You are using the play-slick module for all database accesses, so you should not need to Play jdbc. In fact, as soon as you update to play-slick 1.0.0-RC2 (which was released last week, together with Play 2.4.0-RC3), you will get an exception similar to Second, update to play-slick 1.0.0-RC2 because RC1 had an annoying issue ( that could prevent starting your app.

Otherwise, it's a good article. I'll see how I can clarify why you need both

slick.dbs.default.driver="slick.driver.PostgresDriver$"  slick.dbs.default.db.driver="org.postgresql.Driver"

in your application.conf. But, in a nutshell, the first is the Slick driver (which you will be using in your code), while the second is the JDBC driver which is going to be used by Slick backend. See the Slick documentation for DatabaseConfig

Thanks for trying it out, and taking the time to write about your experience.

Sign in to reply


i am having the same problem

rovisionException: Unable to provision, see the following errors: 1) No implementation for play.api.db.slick.DatabaseConfigProvider was bound. while locating play.api.db.slick.DatabaseConfigProvider for parameter 0 at repo.StudentRepo.<init>(StudentRepo.scala:17) while locating repo.StudentRepo for parameter 0 at controllers.LoginController.<init>(LoginController.scala:24) while locating controllers.LoginController for parameter 6 at router.Routes.<init>(Routes.scala:47) while locating router.Routes while locating play.api.inject.RoutesProvider while locating play.api.routing.Router for parameter 0 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:200) while locating play.api.http.JavaCompatibleHttpRequestHandler while locating play.api.http.HttpRequestHandler

my build.sbt


name := """demo"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
specs2 % Test,
"org.webjars" %% "webjars-play" % "2.5.0-1",
"org.webjars" % "bootstrap" % "3.1.1-2",
"com.adrianhurt" %% "play-bootstrap" % "1.0-P25-B3",
"" %% "play-slick" % "1.1.1",
"com.h2database" % "h2" % "1.4.187" ,
"org.postgresql" % "postgresql" % "9.4-1206-jdbc4",
"com.adrianhurt" %% "play-bootstrap" % "1.0-P25-B3",
"ch.qos.logback" % "logback-classic" % "1.1.3",
"" %% "play-slick-evolutions" % "1.1.1",
"com.typesafe.slick" %% "slick-hikaricp" % "3.1.1",
"com.typesafe.slick" %% "slick" % "3.1.1",
"org.seleniumhq.selenium" % "selenium-server" % "2.52.0",
"org.seleniumhq.selenium" % "selenium-firefox-driver" % "2.52.0",
"org.scalatest" %% "scalatest" % "2.2.1" % "test",
"org.scalatestplus" %% "play" % "1.4.0-M3" % "test",
"org.seleniumhq.selenium" % "selenium-htmlunit-driver" % "2.52.0"

javaOptions in Test += "-Dconfig.file=conf/test.conf"

coverageExcludedPackages :="<empty>;router\\..*;"

resolvers += "scalaz-bintray" at ""

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

resolvers += "Sonatype OSS Snapshots" at ""



Wow! My first comments on this blog.  Thanks for taking the time to check this out.  

I'll be sure to make the changes you mentioned, and update the article as well.


Again, much appreciation for setting me straight, I've got lots more to write about in the coming weeks.