每当我启动Grails应用程序时,所有域类都会收到这些错误。
ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: drop table domain_class cascade constraints
ERROR hbm2ddl.SchemaExport -ORA-01031: insufficient privileges
ERROR hbm2ddl.SchemaExport -ORA-00942: table or view does not exist
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
local {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
development {
dataSource {
dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
grails -Dgrails.env=local run-app -https
启动我的应用程序最佳答案
我们找到了答案。 resources文件夹中dataSource
文件中的instanceConfig.local.properties
指向Oracle数据库,但我没有配置为在该数据库中创建或删除表的角色。因此,权限不足错误。
即使DataSource.groovy
具有内存数据库设置,我仍认为instanceConfig.local.properties
覆盖了它。无论如何,感谢您的帮助!
https://stackoverflow.com/questions/29285521/
相关文章:
git - 如何设置对 ssh git 服务器的只读访问权限?
php - 通过php我如何关闭由php ssh2_connect创建的事件ssh连接?
grails - 在Grails应用程序的主页中更改用户的语言环境
grails - “grails -Dserver.port=9999 run-app”无效
ruby-on-rails-3 - 使用 Heroku 访问和部署问题
angularjs - AngularJS 模板中的 Grails Assets 图像
grails - Grails:如何从BuildConfig.groovy中知道正在执行哪个命令