You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.RuntimeException: Driver org.postgresql.Driver claims to not accept jdbcUrl, ${JDBC_URL:'jdbc:postgresql://127.0.0.1:5432/db?useUnicode=true&characterEncoding=utf8'}
at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:106)
at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:342)
at com.zaxxer.hikari.pool.PoolBase.<init>(PoolBase.java:117)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:107)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:97)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.afterPropertiesSet(LazyConnectionDataSourceProxy.java:162)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.<init>(LazyConnectionDataSourceProxy.java:106)
at org.grails.datastore.gorm.jdbc.connections.DataSourceConnectionSourceFactory.proxy(DataSourceConnectionSourceFactory.java:95)
at org.grails.datastore.gorm.jdbc.connections.DataSourceConnectionSourceFactory.create(DataSourceConnectionSourceFactory.java:88)
at org.grails.datastore.gorm.jdbc.connections.CachedDataSourceConnectionSourceFactory.create(CachedDataSourceConnectionSourceFactory.java:37)
at org.grails.orm.hibernate.connections.AbstractHibernateConnectionSourceFactory.create(AbstractHibernateConnectionSourceFactory.java:38)
at org.grails.orm.hibernate.connections.AbstractHibernateConnectionSourceFactory.create(AbstractHibernateConnectionSourceFactory.java:23)
at org.grails.datastore.mapping.core.connections.AbstractConnectionSourceFactory.create(AbstractConnectionSourceFactory.java:64)
at org.grails.datastore.mapping.core.connections.AbstractConnectionSourceFactory.create(AbstractConnectionSourceFactory.java:52)
at org.grails.datastore.mapping.core.connections.ConnectionSourcesInitializer.create(ConnectionSourcesInitializer.groovy:24)
at org.grails.orm.hibernate.HibernateDatastore.<init>(HibernateDatastore.java:206)
at org.grails.orm.hibernate.HibernateDatastore.<init>(HibernateDatastore.java:260)
at grails.test.hibernate.HibernateSpec.setupSpec(HibernateSpec.groovy:58)
Seems that HibernateSpec does not resolve spring boot externalized configuration.
The text was updated successfully, but these errors were encountered:
You are correct that currently the HibernateSpec does not resolve SpringBoot external configs as application.yml is intended to take the place of application.properties. The current HibernateSpec only reads application.yml and application.groovy.
With that being said I don't believe the error you posted is related. I believe that error is related to a syntax issue in your dataSource. You currently have the following
The above syntax is specifically for picking up command line arguments or system properties (ie. environment variables) NOT values from a properties file.
NOTE: It will only use the secondary string in the event JDBC_URL is null.
Now I think what you are actually try to get at is you want your application.yml to be capable of reading from application.properties. I have added an enhancement with the following pull request #90 that will allow you to use the older style of application.properties instead of either application.yml or application.groovy.
With HibernateSpec now reading application.properties this now allows when both application.propertes and say application.yml are present you can read values from the .properties in the .yml.
NOTE: application.properties must be located alongside other config files in the conf folder for this to work.
WARNING: Key names must be different in application.properties for this to work. If in application.yml you reference url: '${environments.test.dataSource.url}' it will view that as self referencing and will not retrieve the value from application.properties.
Spring boot support Externalized Configuration
Like this:
But HibernateSpec will throw this exception:
Seems that HibernateSpec does not resolve spring boot externalized configuration.
The text was updated successfully, but these errors were encountered: