【问题标题】:No application loader is configured未配置应用程序加载器
【发布时间】:2018-12-07 09:05:25
【问题描述】:

我正在运行 Play documentation 中所述的 Play 应用程序。

java -Dconfig.file='/home/me/production.conf' -jar target/scala-2.11/myplayapp.jar

虽然我的库中包含果汁,但我收到以下错误:

libraryDependencies += guice

我会为此提供适当的帮助。

java.lang.RuntimeException: No application loader is configured. Please configure an application loader either using the play.application.loader configuration property, or by depending on a module that configures one. You can add the Guice support module by adding "libraryDependencies += guice" to your build.sbt.
        at scala.sys.package$.error(package.scala:27)

【问题讨论】:

  • 查看this的帖子有没有解决办法

标签: java playframework sbt


【解决方案1】:

我遇到了同样的问题。我创建了一个多模块项目,并在某个时候决定尝试将 guice 库用于单个模块,因为它是唯一具有播放框架的模块。其他模块只是普通的 Java 项目。 我把

libraryDependencies += guice 

到那个模块。然后问题就出现了。即使我把 guice 移回来也无济于事。奇怪的是,在我恢复项目后,如果我使用

 $sbt run

但它在 Intellij Idea 中不起作用。 为了解决这个问题,我不得不在我的 IDE 中重新导入项目。

【讨论】:

    猜你喜欢
    • 2017-04-15
    • 2020-02-27
    • 2012-08-13
    • 2018-07-25
    • 2016-08-06
    • 1970-01-01
    • 2011-11-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多