خرید بک لینک

Vote count: 0

I can't get slick to work with play 2.5.x

I get the following runtime error:

ProvisionException: 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

My DAO looks like:

@Singleton
class UserDAO @Inject() (protected val dbConfigProvider: DatabaseConfigProvider) 
extends HasDatabaseConfigProvider[JdbcProfile] {
    import driver.api._

...

}

And I just inject it in my controller like:

@Singleton
class UserController @Inject() (ws: WSClient, cache: CacheApi, websiteDAO: WebsiteDAO) extends Controller {
...
}

build.sbt

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  cache,
  ws,
  "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test,
  // database
  jdbc,
  "org.postgresql"     %  "postgresql" % "9.3-1102-jdbc41",
  "com.typesafe.play" %% "play-slick" % "2.0.0"
)

My application.conf has:

play.db {
  # The combination of these two settings results in "db.default" as the
  # default JDBC pool:
  #config = "db"
  #default = "default"

  # Play uses HikariCP as the default coection pool.  You can override
  # settings by changing the prototype:
  prototype {
    # Sets a fixed JDBC coection pool size of 50
    #hikaricp.minimumIdle = 50
    #hikaricp.maximumPoolSize = 50
  }
}

## JDBC Datasource
db {
  default.driver = org.postgresql.Driver
  default.url = "jdbc:postgresql://localhost/testdb_development"
  default.useame = "blankman"
  #default.password = ""
}

If I change my database name I get a coection error, so the pool is picking up my config settings correctly.

asked 11 secs ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 23 تير 1395 ساعت: 4:22

صفحه بندی