我正在尝试在 Play Framework 2.1 的 application.conf 文件中添加新 key 。我添加了以下键:
gen.db.host=localhost
gen.db.port=27017
gen.db.name=test
当我启动我的应用程序时,它抛出以下错误:
Configuration error: Configuration error[application.conf: 46: port has type NUMBER rather than OBJECT]
......
......
......
Caused by: com.typesafe.config.ConfigException$WrongType: application.conf: 46: port has type NUMBER rather than OBJECT
我不明白这个问题。我该如何解决它?另外,在 application.conf 文件中定义新 key 是一个好习惯吗?
谢谢。
最佳答案
将端口放在双引号之间:
gen.db.port="27017"
关于java - 在 Play 框架应用程序 conf 文件中定义键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17577314/