我在 BootStrap.groovy 的 init 闭包中有以下代码
private def setupDefaultAdmin = {
log.info "Adding default user to system"
// create the super user/admin account
if (SentryUser.findAllByUsername("test@test.org") == null) {
def admin = new SentryUser(username: "test@test.org",password: 'password',
enabled: true).save(failOnError: true)
admin = new SentryUser(username: "admin@test.org",password: 'password',
enabled: true).save(failOnError: true)
}
}
当我将此应用程序部署到 JBOSS 容器 7.1 版时,我在部署时不断进入无限循环。我的数据库配置如下
production {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}