我在生产模式下运行Play 2.4服务器时遇到此错误:
play.api.UnexpectedException: Unexpected exception[ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, @6mh5cjo5l: Configuration error
while locating play.api.libs.CryptoConfigParser
while locating play.api.libs.CryptoConfig
...
Caused by: play.api.PlayException: Configuration error[Application secret not set]
怎么修?
解决方法:
play.crypto.secret="changeme"
在application.conf中需要更改才能在生产中使用. Play提供了一个实用程序来为您生成随机秘密:
./activator playGenerateSecret
然后,您可以使用它作为环境变量填充:
APPLICATION_SECRET=...
并在conf / application.conf中确保以下内容:
play.crypto.secret="changeme"
play.crypto.secret=${?APPLICATION_SECRET}
正如Play documentation解释的那样:
The second line in that configuration sets the secret to come from an
environment variable called APPLICATION_SECRET if such an environment
variable is set, otherwise, it leaves the secret unchanged from the
prevIoUs line.
然后错误就会消失.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。