Discussion:
Problem with the way external properties configuration loads
Antony Jones
2014-04-04 16:38:41 UTC
Permalink
Hi All.

I've been forced to look at loading an external properties file to
configure various attributes within Grails in the last week or so, and I
was quite amazed by some massive inconsistencies I've had to overcome.

Firstly there is the datasource confguration. If you want dbCreate to be
acknoweldged - you cannot externalise the configuration. It simply doesn't
create the tables for you if you are using create-drop.

Secondly dataSource again - I want to externalise the URL, and if I do so -
I can't have a value in config like 'use external value' as it will try to
connect to it first and fall over - probably because of the above problem?

Thirdly I want external config to load and override values in my Config
file - as the documentation says it should. However plugins, such as my own
'oauth' plugin demonstrate that this doesn't happen immediately. I have
checks for null values on the oauth config and every single one fails and
causes the server to terminate. These checks are done at service level so
for some reason - spring is wiring BEFORE the configuration has been
properly set from the external values?

These issues aren't obvious from the documentation, and are even less
obvious from a convention over configuration standpoint.

Is something perhaps going horribly wrong, or is this expected behaviour?
The ordering seems a bit crazy.

Cheers,
Antony
--
________________________________
ꜜ . antony jones . http://www.enzy.org
Graeme Rocher
2014-04-07 09:46:42 UTC
Permalink
Does seem wrong, please JIRA with steps to reproduce
Post by Antony Jones
Hi All.
I've been forced to look at loading an external properties file to configure
various attributes within Grails in the last week or so, and I was quite
amazed by some massive inconsistencies I've had to overcome.
Firstly there is the datasource confguration. If you want dbCreate to be
acknoweldged - you cannot externalise the configuration. It simply doesn't
create the tables for you if you are using create-drop.
Secondly dataSource again - I want to externalise the URL, and if I do so -
I can't have a value in config like 'use external value' as it will try to
connect to it first and fall over - probably because of the above problem?
Thirdly I want external config to load and override values in my Config file
- as the documentation says it should. However plugins, such as my own
'oauth' plugin demonstrate that this doesn't happen immediately. I have
checks for null values on the oauth config and every single one fails and
causes the server to terminate. These checks are done at service level so
for some reason - spring is wiring BEFORE the configuration has been
properly set from the external values?
These issues aren't obvious from the documentation, and are even less
obvious from a convention over configuration standpoint.
Is something perhaps going horribly wrong, or is this expected behaviour?
The ordering seems a bit crazy.
Cheers,
Antony
--
________________________________
ꜽ . antony jones . http://www.enzy.org
--
Graeme Rocher
Grails Project Lead
SpringSource

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Continue reading on narkive:
Loading...