grails - Grails错误:表或​​ View 不存在

每当我启动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.groovy包含以下内容:
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启动我的应用程序

我尝试在启动期间使用BootStrap.groovy创建对象,甚至它们失败。我使用GGTS进行开发。这是什么特权?

最佳答案

我们找到了答案。 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 图像

ssh - 如何从第二台机器访问 Github 存储库?

grails - Grails:如何从BuildConfig.groovy中知道正在执行哪个命令

exception - 如何在事务中从 Grails 中的数据库错误中恢复

grails - 使用插件时如何在Grails中添加Quartz监听器