0

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: 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:

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!

Trung Huynh
  • 293
  • 1
  • 5
  • 13

1 Answers1

2
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.

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
  • As I said, it will create table in development mode, so, I don't know why at development mode, it stops at `Configuring Spring Security OAuth ...` and wait for input(althought it's still not continue) and show time out error later. Here is all `| Loading Grails 2.1.0 | Configuring classpath. | Environment set to development..... | Packaging Grails application..... | Compiling 6 source files..... | Running Grails application Configuring Spring Security Core ... ... finished configuring Spring Security Core Configuring Spring Security OAuth ...` – Trung Huynh Aug 06 '13 at 09:34