尝试使Play,Ebean和H2一起工作会导致“ Play-ebean配置错误,请检查您的配置文件”

时间:2018-08-25 06:21:52

标签: java playframework playframework-2.0 ebean h2db

我正在尝试让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);
    }
}

这可能是我所缺少的小东西,但是我无法弄清楚...友好的文档非常稀少,而且我发现相互矛盾的解决方案有时由于以下原因不再起作用现在缺少的课程。

0 个答案:

没有答案