문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top