お世話になってます。
Mysqlへの接続において、application.confファイルの設定内容が
おかしいため接続できません。
周辺のファイルも掲載しているので是非、ご教示下さい。
以上、宜しくお願いします。
●plugin.sbt
// The Play plugin addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10") // Web plugins addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0") addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.0") addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.4") addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.8") addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.1") addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0") addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.6") // Play enhancer - this automatically generates getters/setters for public fields // and rewrites accessors of these fields to use the getters/setters. Remove this // plugin if you prefer not to have this feature, or disable on a per project // basis using disablePlugins(PlayEnhancer) in your build.sbt addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0") // Play Ebean support, to enable, uncomment this line, and enable in your build.sbt using // enablePlugins(PlayEbean). addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.2") addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
●build.sbt
name := """Nitta""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean) scalaVersion := "2.11.7" libraryDependencies ++= Seq( javaJdbc, cache, javaWs ) routesGenerator := InjectedRoutesGenerator EclipseKeys.preTasks := Seq(compile in Compile) EclipseKeys.projectFlavor := EclipseProjectFlavor.Java EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) libraryDependencies += "com.zaxxer" % "HikariCP" % "2.7.1" libraryDependencies += "mysql" % "mysql-connector-java" % "8.0.13"
●エラー内容
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]] at play.api.Configuration$.configError(Configuration.scala:154) at play.api.Configuration.reportError(Configuration.scala:806) at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:48) at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:42) at scala.collection.immutable.List.foreach(List.scala:381) at play.api.db.DefaultDBApi.connect(DefaultDBApi.scala:42) at play.api.db.DBApiProvider.get$lzycompute(DBModule.scala:72) at play.api.db.DBApiProvider.get(DBModule.scala:62) at play.api.db.DBApiProvider.get(DBModule.scala:58) at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) Caused by: play.api.Configuration$$anon$1: Configuration error[jdbcUrl is required with driverClassName.] at play.api.Configuration$.configError(Configuration.scala:154) at play.api.PlayConfig.reportError(Configuration.scala:996) at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:70) at play.api.db.PooledDatabase.createDataSource(Databases.scala:199) at play.api.db.DefaultDatabase.dataSource$lzycompute(Databases.scala:123) at play.api.db.DefaultDatabase.dataSource(Databases.scala:121) at play.api.db.DefaultDatabase.getConnection(Databases.scala:142) at play.api.db.DefaultDatabase.getConnection(Databases.scala:138) at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:44) at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:42) Caused by: java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName. at com.zaxxer.hikari.HikariConfig.validate(HikariConfig.java:893) at play.api.db.HikariCPConfig.toHikariConfig(HikariCPModule.scala:141) at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:57) at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:54) at scala.util.Try$.apply(Try.scala:192) at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:54) at play.api.db.PooledDatabase.createDataSource(Databases.scala:199) at play.api.db.DefaultDatabase.dataSource$lzycompute(Databases.scala:123) at play.api.db.DefaultDatabase.dataSource(Databases.scala:121) at play.api.db.DefaultDatabase.getConnection(Databases.scala:142)
●application.conf
akka { } play.crypto.secret = "changeme" play.modules { enables += "play.api.db.DBModule" enables += "play.api.db.HikariCPModule" } fixedConnectionPool=2 play.i18n { langs = [ "en" ] } play.http { session { } flash { } } play.server.netty { } play.ws { ssl { } } play.cache { } play.filters { cors { } csrf { } headers { } hosts { } } play.evolutions { db.default.enabled = false } play.db { prototype { } } db.default.driver=com.mysql.jdbc.Driver db.default.username=root db.default.password="nfgwe4706" db.default.jdbcUrl="jdbc:mysql://localhost:3306/sample_db" db.default.hikaricp.driverClassName=com.mysql.cp.jdbc.Driver db.default.hikaricp.username=root db.default.hikaricp.password="nfgwe4706" db.default.hikaricp.jdbcUrl="jdbc:mysql://localhost:3306/sample_db" db.default.hikaricp.minimumIdle=${fixedConnectionPool} db.default.hikaricp.maximumPoolSize=${fixedConnectionPool} ebean.default=["model.*"] "assets.cache./public/stylesheets/bootstrap.min.css"="max-age=3600" database.dispatcher{ type=Dispatcher executor="thread-pool-executor" throughput=1 thread-pool-executor{ fixed-pool-size = ${fixedConnectionPool} } }
回答2件
あなたの回答
tips
プレビュー