我正在使用 Play 框架开发一个项目。昨天,“某事”发生了,我的 Play.Configuration 对象在初始化后为空。我已尝试追溯我的步骤,但我无法找到我所做的导致错误的更改!
虽然谷歌通常是我的 friend ,但我找不到太多关于这个问题的信息。有谁知道我可以/应该从哪里着手解决这个问题?
最佳答案
感谢 Morten Kjetland,who provided this answer on the play-framework google group ,我发现错误的原因如下:
It looks like you run the test directly in IntelliJ.
When you do it like this, Play it self is not running - nor is it initialized.
When running tests that use Play features like that you have to run them in play:
"play test" and goto http://localhost:9000/@tests
or "play auto-test"
-Morten
令人尴尬的是,我确实知道@tests url,但我有点天真,认为如果我运行 Play,那么 intelliJ 会以某种方式神奇地找到 Play 的实例(不确定我为什么这么想)并相应地进行测试.
无论如何 - 我希望我的错误将来能帮助其他人 - 再次感谢 stack overflow 上的乐于助人的人特别是 play-framework google group!
关于java - Play Framework 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5880665/