gpt4 book ai didi

grails - 无法在grails中使用progresql

转载 作者:行者123 更新时间:2023-12-02 15:10:01 25 4
gpt4 key购买 nike

我正在导入一个存在的grails项目,该项目使用postgresql使用远程postgresql,它们是在真实计算机上构建的,现在我需要在我的本地主机上执行,并在本地使用postgresql。

一切正常,但系统可以使用postgresql,尽管我在datasource.config中进行了设置。我的datasource.config与旧的真实源相似,只是在远程服务器和本地服务器之间进行了一些更改。这是我的datasource.config。

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 {
production {
pooled = true
driverClassName = "org.postgresql.Driver"
username = "postgres"
password = "postgres"
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate'
url = "jdbc:postgresql://localhost:5432/faql_dev"
}
}

这是我遇到的一些错误:
Caused by: org.compass.gps.device.hibernate.HibernateGpsDeviceException: {hibernate}: Failed to index the database; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query using scroll
at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:172)
at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:104)
at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:133)
at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:147)
at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:102)
... 5 more
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query using scroll
at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:118)
... 10 more
Caused by: org.h2.jdbc.JdbcSQLException: Table "QUESTION" not found; SQL statement:

我导入了所有与postgresql有关的内容,因此我可以在开发模式下基于域创建表,但无法运行它。在生产中,它将抛出该异常。

提前致谢!

最佳答案

Caused by: org.h2.jdbc.JdbcSQLException

这向我表明您使用了错误的JDBC驱动程序。您发布的数据源配置仅将应用设置为在生产模式下使用Postgres,如果您在开发模式下本地运行,则它将使用默认的H2数据库。

关于grails - 无法在grails中使用progresql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18075479/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com