A binding to play.api.db.DBApi was already configured, evolutions and injector error with play-slick

前端 未结 2 593
半阙折子戏
半阙折子戏 2021-01-01 10:37

I want to introduce slick to my play project, so I add the following dependencies to build.sbt:

\"com.typesafe.play\"          %% \"play-slick\"                      


        
相关标签:
2条回答
  • 2021-01-01 11:08

    If you are like me, you have something like this in your build.sbt

    libraryDependencies ++= Seq(
      jdbc,
      cache,
      ws,
      specs2 % Test,
      "mysql" % "mysql-connector-java" % "5.1.37",
      "com.typesafe.play" %% "play-slick" % "1.1.1",
      "com.typesafe.play" %% "play-slick-evolutions" % "1.1.1"
    )
    

    remove jdbc

    libraryDependencies ++= Seq(
      //jdbc, //<<---- this one here
      cache,
    
    0 讨论(0)
  • 2021-01-01 11:10

    You have probably added dependency to jdbc which doesn't make sense if you use slick for it. Remove it and it will work.

    0 讨论(0)
提交回复
热议问题