播放 2.4 控制台无法按文档工作 [英] play 2.4 console not working as documented

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

问题描述

我最近更新为播放 2.4.1 (damiya) 版本,并且始终能够通过 intellij 和在终端窗口中输入 activator console 进入 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.

但是,我无法让它在 play 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.

推荐答案

Richard 在此提交中解释:

Richard explains in this commit:

此更改使启动应用程序的生命周期大大缩短更清晰.

Refactored server start code into prod, dev, test modes

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

  • 不再需要 Netty 和 Akka HTTP 的单独 ServerStart 实现,因为 ServerProvider 配置总是从
    配置文件.而是根据模式分离出代码服务器在其中运行,因为行为可能因模式而异.现在我们有 ProdServerStart、DevServerStart 和 DocServerStart.
  • 对于每种模式,将 ApplicationProvider 代码移动到与新服务器启动代码相同的文件中.移动用于启动应用程序的代码离开 ApplicationProvider 构造函数并进入服务器
    开始代码.ApplicationProviders 仍然实现 'get' 方法
    用于获取当前应用程序.
  • 删除 TestApplication 和 StaticApplication,因为它们做同样的事情.而是为静态"应用程序提供帮助程序
    不需要重新加载.

您可以执行以下相同的操作:

You can do the same thing as follows:

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

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

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