play framework alternate application.conf file slick 数据源连接失败
play framework alternate application.conf file slick datasource connection failing
我的应用程序正在使用 application.conf。我现在希望此应用程序的副本 运行 有所不同,因此我为此实例创建了一个备用 conf 文件。
应用程序运行,我可以访问静态资源,但是,需要访问数据源的端点没有响应。这是 Slick 的限制吗?这里有什么问题?
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
我认为您在 alternate.conf
中的 include 语句有误
您需要将文件扩展名保留为..
include "application.conf"
我的应用程序正在使用 application.conf。我现在希望此应用程序的副本 运行 有所不同,因此我为此实例创建了一个备用 conf 文件。
应用程序运行,我可以访问静态资源,但是,需要访问数据源的端点没有响应。这是 Slick 的限制吗?这里有什么问题?
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
我认为您在 alternate.conf
您需要将文件扩展名保留为..
include "application.conf"