我正在尝试让H2和Ebean在PlayFramework中一起工作,但始终会导致Error in custom provider, java.lang.RuntimeException: Bad play-ebean configuration, check your configuration file
。
这是我相关的配置:
application.conf
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
ebean.default = ["models.*"]
plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.18")
addSbtPlugin("com.payintech" % "sbt-play-ebean" % "18.08")
build.sbt
lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)
libraryDependencies += guice
libraryDependencies += "com.h2database" % "h2" % "1.4.197"
libraryDependencies += filters
libraryDependencies += "joda-time" % "joda-time" % "2.10"
GVBServerStartupConfig.java
package models;
import io.ebean.config.ServerConfig;
import org.avaje.datasource.DataSourceConfig;
import io.ebean.event.ServerConfigStartup;
public class GVBServerConfigStartup implements ServerConfigStartup {
public void onStart(ServerConfig serverConfig) {
serverConfig.setDatabaseSequenceBatchSize(1);
}
}
这可能是我所缺少的小东西,但是我无法弄清楚...友好的文档非常稀少,而且我发现相互矛盾的解决方案有时由于以下原因不再起作用现在缺少的课程。