在grails中不能使用progresql

编程入门 行业动态 更新时间:2024-10-23 18:23:54
本文介绍了在grails中不能使用progresql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在导入一个存在的grails项目,这个项目使用postgresql使用远程postgresql,他们在真正的机器上构建它,现在我需要在我的本地主机上执行它,并使用postgresql local。

一切正常,但系统可以使用postgresql,尽管我在datasource.config中设置了它。我的datasource.config类似于旧的真正的,只是改变了远程服务器和本地服务器之间的东西。这是我的datasource.config。 $ h $ { cache.use_second_level_cache = true cache.use_query_cache = false cache.region.factory_class ='net.sf.ehcache.hibernate.EhCacheRegionFactory' } //环境特定设置环境{ 生产{汇集= TRUE driverClassName = org.postgresql.Driver 的用户名= Postgres的 密码= Postgres的 dbCreate的= create-drop//创建一个'create-drop','update','validate' url =jdbc:postgresql:// localhost:5432 / faql_dev} }

这是我得到的一些错误:

原因:orgpass.gps.device.hibernate.HibernateGpsDeviceException:{hibernate}:无法索引数据库;嵌套的例外是org.hibernate.exception.SQLGrammarException:使用滚动在orgpass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:172)。在组织无法执行查询pass.gps.device.support.parallel.ConcurrentParallelIndexExecutor $ 1 $ 1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:104)。在orgpass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)。在有机pass.core.CompassTemplate.execute(CompassTemplate.java:133)在orgpass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:147)在orgpass.gps.device org.hibernate.exception.SQLGrammarException:.support.parallel.ConcurrentParallelIndexExecutor $ 1.call(ConcurrentParallelIndexExecutor.java:102) ... 5个所致使用滚动无法执行查询在orgpass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitie sIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:118) ... 10个引起的:org.h2.jdbc.JdbcSQLException:表 问题 没有找到; SQL语句:

我将一切都涉及到postgresql,所以我可以在开发模式下基于域创建表,但我无法运行它。在生产中,它会抛出这个异常。

预先感谢! 解决方案

造成者:org.h2.jdbc.JdbcSQLException

这表明你正在使用错误的JDBC驱动程序。您发布的数据源配置只会在 production 模式下将应用设置为使用Postgres,如果您在dev模式下以本地方式运行,那么它将使用默认的H2数据库。

I'm importing a exists grails project, this project use postgresql use remote postgresql, they built it on real machine, now I need do it on my localhost machine, and use postgresql local.

Everything is OK, but the system can use postgresql, althought I set up it in datasource.config. My datasource.config is similar to old real one, just change something between remote server and local server. Here is my 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" } }

Here is some error I got:

Caused by: orgpass.gps.device.hibernate.HibernateGpsDeviceException: {hibernate}: Failed to index the database; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query using scroll at orgpass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:172) at orgpass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:104) at orgpass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29) at orgpass.core.CompassTemplate.execute(CompassTemplate.java:133) at orgpass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:147) at orgpass.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 orgpass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:118) ... 10 more Caused by: org.h2.jdbc.JdbcSQLException: Table "QUESTION" not found; SQL statement:

I imported everything involve to postgresql, So I can create table based on domain in development mode, but I can't run it. In production, it will throw that exception.

Thanks in advance!

解决方案

Caused by: org.h2.jdbc.JdbcSQLException

This suggests to me that you're using the wrong JDBC driver. The data source configuration you've posted only sets the app up to use Postgres in production mode, if you run locally in dev mode then it'll use the default H2 database.

更多推荐

在grails中不能使用progresql

本文发布于:2023-11-05 09:58:53,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中不   grails   progresql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!