首页 > 解决方案 > 未配置应用程序加载器

问题描述

我正在运行Play 文档中描述的 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)

标签: javaplayframeworksbt

解决方案


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

libraryDependencies += guice 

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

 $sbt run

但它在 Intellij Idea 中不起作用。为了解决它,我必须在我的 IDE 中重新导入项目。


推荐阅读