播放2.4控制台无法正常工作 [英] play 2.4 console not working as documented

查看:133
本文介绍了播放2.4控制台无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了玩2.4.1(damiya)版本,并且始终能够通过intellij进入scala控制台并在我的终端输入激活控制台窗口。然后我会通过输入以下代码行来启动一个新的静态应用程序:

i have recently updated to play 2.4.1 (damiya) release and have always been able to enter the scala console both through intellij and by entering activator console in my terminal window. I would then start a new static application by entering this line of code:

new play.core.StaticApplication(new java.io.File( 。))

,如播放网站本身以及关于SO的类似旧问题的一些答案。

as documented on the play website itself as well as on some answers to similar older questions on SO.

然而,我无法让它在游戏2.4.1上运行,错误被返回为:

however, i am unable to get this to work on play 2.4.1, with the error being returned as :

<console>:8: error: type StaticApplication is not a member of package play.core
          new play.core.StaticApplication(new java.io.File("."))
                        ^ `

任何关于如何解决这个问题的建议都会很大感谢,控制台过去对我非常有用,而且对于调试来说非常重要。

any advice on how to fix this would be greatly appreciated, the console was immensely useful to me in the past and rather essential for debugging purposes.

推荐答案

理查德在此解释提交


重构服务器将代码启动到prod,dev,测试模式



此更改使启动应用程序的生命周期更加清晰

Refactored server start code into prod, dev, test modes

This change makes the lifecycle for starting up applications much clearer.


  • 不再需要单独的ServerStart实现Netty和Akka HTTP,因为始终从

    配置文件加载ServerProvider配置。相反,根据服务器运行的模式
    分离出代码,因为行为可能因模式而异。现在
    我们有一个ProdServerStart,DevServerStart和一个DocServerStart。

  • 对于每种模式,将ApplicationProvider代码移动到与新服务器启动代码相同的文件中。移动代码以启动ApplicationProvider构造函数中的应用程序
    并进入服务器

    start code。 ApplicationProviders仍然实现'get'方法

    来获取当前的Application。

  • 删除TestApplication和StaticApplication,因为它们做同样的事情。而是为'静态'应用程序提供帮助,而
    不需要重新加载。

你可以做同样的事情:

play.core.server.ProdServerStart.main(Array())

这篇关于播放2.4控制台无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆