如果数据库不存在,H2 应该创建它。我修改了 url,将“mem”更改为“file”,并将下一个参数“play”更改为以新名称为后缀的路径,该名称将成为数据库。但是,我不断收到此异常:
Database error
A database error occured : No database found. Check the configuration of your application.
play.exceptions.DatabaseException: No database found. Check the configuration of your application.
at play.db.DB.getConnection(DB.java:65)
at play.modules.siena.PlayConnectionManager.getConnection(PlayConnectionManager.java:16)
at play.modules.siena.SienaPlugin.onApplicationStart(SienaPlugin.java:138)
at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:525)
at play.Play.start(Play.java:526)
at play.Play.detectChanges(Play.java:630)
at play.Invoker$Invocation.init(Invoker.java:198)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
at play.db.DB.getConnection(DB.java:58)
这是活跃的环境:
%h2dev.application.mode=dev
%h2dev.db.url=jdbc:h2:file:/var/stkdb/h2.db;MODE=MYSQL;LOCK_MODE=0
%h2dev.jpa.ddl=create
%h2dev.mail.smtp=mock
有任何想法吗?我也安装了 GAE 模块。不过那应该没关系...