我試圖在play Framework 2.1中的application.conf文件中添加新的鍵。我已經添加下面的鍵:在播放框架應用程序conf文件中定義鍵
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文件中定義新的密鑰是否是一種好的做法?
謝謝。
它被扔配置錯誤:配置錯誤[application.conf:46:端口的類型是STRING而不是OBJECT] – popcoder
請添加從配置文件中讀取的代碼。 –