简体   繁体   English

播放框架配置

[英]Play Framework Configuration

I am developing a project using the Play framework.我正在使用 Play 框架开发一个项目。 Yesterday, 'something' happened and my Play.Configuration object is null after initialisation.昨天,“某事”发生了,初始化后我的 Play.Configuration object 是 null。 I have tried retracing my steps but I am unable to locate the change that I have made that has resulted in the error!我已尝试追溯我的步骤,但我无法找到我所做的导致错误的更改!

Although Google is usually my friend, I have not been able to find much information on this problem.虽然谷歌通常是我的朋友,但我一直没能找到很多关于这个问题的信息。 Does anyone know where I can / should start looking to try to resolve this?有谁知道我可以/应该在哪里开始尝试解决这个问题?

Thanks to Morten Kjetland, who provided this answer on the play-framework google group , I have found the reason for the error was as follows:感谢 Morten Kjetland, 他在 play-framework google group 上提供了这个答案,我发现错误的原因如下:

It looks like you run the test directly in IntelliJ.看起来您直接在 IntelliJ 中运行测试。

When you do it like this, Play it self is not running - nor is it initialized.当你这样做时,Play it self 没有运行 - 也没有初始化。

When running tests that use Play features like that you have to run them in play:在运行使用类似 Play 功能的测试时,您必须在运行中运行它们:

"play test" and goto http://localhost:9000/@tests “玩测试”并转到http://localhost:9000/@tests

or "play auto-test"或“播放自动测试”

-Morten -莫腾

Embarrassingly I did know about @tests url, but I was a little naiive and thought that if I had the Play running then intelliJ would somehow magically find that instance of Play (not sure why I thought that) and conduct the tests accordingly.令人尴尬的是,我确实知道@tests url,但我有点天真,并认为如果我让 Play 运行,那么 intelliJ 会以某种方式神奇地找到 Play 的实例(不知道我为什么这么认为)并进行相应的测试。

Anyway - I hope my mistake will help someone else in the future - and thanks again to the helpful people on stack overflow and particularly the play-framework google group!无论如何-我希望我的错误将来会对其他人有所帮助-再次感谢堆栈溢出方面的乐于助人的人,尤其是play-framework google小组!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM