使用play-hikaricp播放框架2.3 classnotfound

时间:2014-09-14 04:14:39

标签: mysql playframework playframework-2.0 typesafe-activator hikaricp

当我尝试配置我的Play 2.3应用程序以使用hikaricp

时,我不断获得以下堆栈跟踪
java.lang.RuntimeException: java.lang.ClassNotFoundException: "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
 com.zaxxer.hikari.util.PoolUtilities.createInstance(PoolUtilities.java:105)
 com.zaxxer.hikari.pool.HikariPool.initializeDataSource(HikariPool.java:518)
 com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:137)
 com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:102)
 com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)
 com.edulify.play.hikaricp.HirakiCPDBApi$$anonfun$1.apply(HirakiCPDBApi.scala:36)
 com.edulify.play.hikaricp.HirakiCPDBApi$$anonfun$1.apply(HirakiCPDBApi.scala:32)
 scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
 scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
 scala.collection.immutable.Set$Set1.foreach(Set.scala:79)
 scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
 scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
 scala.collection.SetLike$class.map(SetLike.scala:92)
 scala.collection.AbstractSet.map(Set.scala:47)

我的build.sbt包含mysql-connector,它应该在classpath

name := """myapp"""

version := "2.3-SNAPSHOT"

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

scalaVersion := "2.11.1"

resolvers += Resolver.url("Edulify Repository", url("http://edulify.github.io/modules/releases/"))(Resolver.ivyStylePatterns)

libraryDependencies ++= Seq(
    javaCore,
    "mysql" % "mysql-connector-java" % "5.1.18",
    javaJdbc,
    "org.codehaus.jackson" % "jackson-mapper-asl" % "1.9.13",
    "com.lowagie" % "itext" % "2.1.7",
    "net.sf.jasperreports" % "jasperreports" % "5.2.0",
    "org.mindrot" % "jbcrypt" % "0.3m",
    javaEbean,
    cache,
    javaWs,
    "com.edulify" %% "play-hikaricp" % "1.4.1"
)

这里也是我的conf / play.plugins文件:

200:com.edulify.play.hikaricp.HikariCPPlugin

任何帮助将不胜感激

〜尼克

1 个答案:

答案 0 :(得分:0)

同样的问题发生在我身上我认为你提供的hikaricp.prod.properties文件中 jdbcUrl =“ JDBC_CONNECTION 删除引号解决了问题 jdbcUrl = JDBC_CO