play framework alternate application.conf文件slick datasource连接失败

时间:2016-03-31 16:39:30

标签: playframework configuration slick

我的应用程序正在使用application.conf。我现在想要以不同的方式运行此应用程序的副本,因此我为此实例创建了一个备用conf文件。

应用程序运行,我可以访问静态资源,但是,需要访问数据源的端点不响应。这是一个光滑的限制吗?这有什么不对?

application.conf

play.crypto.secret = "onlyHoudiniKnows"    
play.i18n.langs = [ "en" ]
slick.dbs.default.driver="slick.driver.MySQLDriver$"
slick.dbs.default.db.driver="com.mysql.jdbc.Driver"
slick.dbs.default.db.url="jdbc:mysql://localhost:3306/mydb?user=myuser"
slick.dbs.default.db.password="password"

alternate.conf

include "application"

play.crypto.secret="onlyDavidCopperfieldKnows"
slick.dbs.default.db.url="jdbc:mysql://localhost:3306/myalternatedb?user=myalternateuser"
http.port=9005
play.evolutions.db.default.autoApply=true

startserver.sh

#!/bin/bash
echo "Starting My Server..."
/myserver-1.0-SNAPSHOT/bin/myserver -Dconfig.file=/myserver-1.0-SNAPSHOT/conf/alternate &
exit 0

1 个答案:

答案 0 :(得分:0)

我认为alternate.conf

中的include语句存在错误

您需要保留文件扩展名,如..

include "application.conf"