scala - Play error on startup: No implementation for play.api.db.Database was bound -
when attempt run play application (play 2.5.4) following error:
provisionexception: unable provision, see following errors: 1) no implementation play.api.db.database bound. while locating play.api.db.database parameter 0 @ ds.qb.manage.managequerybuilder.<init>(managequerybuilder.scala:30) while locating ds.qb.manage.managequerybuilder parameter 16 @ router.routes.<init>(routes.scala:107) while locating router.routes while locating play.api.inject.routesprovider while locating play.api.routing.router parameter 0 @ play.api.http.javacompatiblehttprequesthandler.<init>(httprequesthandler.scala:200) while locating play.api.http.javacompatiblehttprequesthandler while locating play.api.http.httprequesthandler parameter 4 @ play.api.defaultapplication.<init>(application.scala:221) @ play.api.defaultapplication.class(application.scala:221) while locating play.api.defaultapplication while locating play.api.application
this database setup, ideas? have definition twice because access database both through slick , jdbc.
play.db { # combination of these 2 settings results in "db.default" # default jdbc pool: config = "db" default = "default" # play uses hikaricp default connection pool. can override # settings changing prototype: #prototype { # sets fixed jdbc connection pool size of 50 #hikaricp.minimumidle = 50 #hikaricp.maximumpoolsize = 50 #} } db.default.driver=com.mysql.jdbc.driver db.default.url="jdbc:mysql://localhost:3306/db2" db.default.username=root db.default.password=xxxxx db2 = { url = "jdbc:mysql://localhost:3306/db2" driver = com.mysql.jdbc.driver connectionpool = disabled keepaliveconnection = true user=root password=xxxxxx }
update
the build.sbt file:
name := """myapp""" version := "1.0-snapshot" lazy val root = (project in file(".")).enableplugins(playscala) scalaversion := "2.11.7" librarydependencies ++= seq( jdbc, cache, ws, "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % test ) librarydependencies += "com.typesafe.slick" %% "slick" % "3.1.1" librarydependencies += "com.typesafe.play" %% "play-slick" % "2.0.0" librarydependencies += "mysql" % "mysql-connector-java" % "5.1.18" librarydependencies += "org.pivot4j" % "pivot4j-core" % "0.9" librarydependencies += "org.scalaz" %% "scalaz-core" % "7.1.0" // properties file librarydependencies += "com.typesafe" % "config" % "1.3.0" librarydependencies += "org.slf4j" % "slf4j-nop" % "1.6.4" librarydependencies += "log4j" % "log4j" % "1.2.14" resolvers += "scalaz-bintray" @ "http://dl.bintray.com/scalaz/releases" // mondrian resolvers += "pentaho releases" @ "http://repository.pentaho.org/artifactory/repo/"
Comments
Post a Comment