Found out that it is a known bug in Play 2.1. It has been fixed in the subsequent version. I do not encounter this problem anymore after the framework is upgraded.
Play doesn't recognise the new configuration filename while using config.resource
-
23-09-2022 - |
Pergunta
Everything goes normally if I put the application.conf
file in the my_project/conf
folder. I can access the website and query the database as expected.
And then I decided to rename the file application.conf to dev.conf
file in order to organise the different settings for every environment.
If I put it in root path d:/dev.conf
and I execute this command:
[library] $ run -Dconfig.file=d:/dev.conf
This new file is recognised and the configured values are applied as expected. No problem here. But if I put it in the usual folder (my_project/conf
) and execute this command:
[library] $ run -Dconfig.resource=dev.conf
the configuration doesn't take effect. I can still access the site but whenever there is an operation involving a database operation it will throw an error below:
play.api.Application$$anon$1: Execution exception[[Exception: DB plugin is not registered.]] ... ...
The documentation mentioned that -Dconfig.resource
will automatically grab the intended file in the conf folder. I have already put the file in that folder but somehow my program cannot find it. Am I missing anything here?
Solução