java - 未配置应用程序加载器
问题描述
我正在运行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)
解决方案
我有同样的问题。我创建了一个多模块项目,并在某个时候决定尝试将 guice 库用于单个模块,因为它是唯一具有播放框架的模块。其他模块只是普通的 Java 项目。我放
libraryDependencies += guice
到那个模块。然后问题就出现了。即使我把 guice 移回来也无济于事。奇怪的是,在我恢复项目后,如果我使用
$sbt run
但它在 Intellij Idea 中不起作用。为了解决它,我必须在我的 IDE 中重新导入项目。
推荐阅读
- android - Android:如何录制视频并将其实时发送到服务器
- list - Flutter - 明智地分组日期并显示在粘性标题下
- terraform - 当父资源计数为零时,depends_on 资源仍会尝试运行
- javascript - 如何根据商品数量计算每件商品的价格?
- arrays - 在参数声明中指定数组的大小有什么意义?
- python - Altair 颜色分级值
- python - 如何在python中为模块设置日志记录环境
- excel - VBA中两个二维数组之间的区别
- javascript - JavaScript - 如何遍历对象数组
- python - 构建具有任意层数的 Keras 模型的函数