繁体   English   中英

使用激活器启动播放服务器引发application.conf找不到错误

[英]Starting play server with activator throw an application.conf not found error

我有一个很奇怪的问题。

我正在使用play 2.3创建服务器。 当我使用activator run启动它时,它可以完美activator run 但是,如果我使用activator start以部署模式启动服务器,则会收到IOException:找不到用于application.conf的文件。

Configuration error: Configuration error[application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties]

当我运行activator windows:packageBin它会向我发出有关驱逐库的警告:

[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]  * com.typesafe.sbt:sbt-native-packager:0.7.4 -> 1.0.3
[warn] Run 'evicted' to see detailed eviction warnings

奇怪的是,它已经在几个月前开始运作了...

这是我的build.sbt文件:

name := """IdTabDriver"""
version := "1.0.0.1"

name in Windows := "IdTabDriver"

//packageSummary in Windows := "IdTabDriver"

//packageDescription in Windows := "IdTabDriver"

maintainer in Windows := "Access France"

organization := "Access France"

lazy val root = (project in file(".")).enablePlugins(PlayJava).enablePlugins(JavaAppPackaging)

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  cache,
  javaWs,
  "commons-configuration" % "commons-configuration" % "1.10",
  "org.rxtx" % "rxtxcomm" % "2.0-7pre1"
)

还有我的plugin.sbt文件:

resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.3")

编辑:我已经使用-Dconfig.file=conf/application.conf选项来解决先前的异常,但是我得到了一个新的异常

Configuration error: Configuration error[Cannot initialize the custom Global object (controllers.Global) (perhaps it's a wrong reference?)]

您遇到的问题是众所周知的#499#554播放中#4242

Playframework 2.3.x并未完全使用AutoPlugins。 当您混合使用AutoPlugins(sbt-native-packager 1.0.3)和非AutoPlugin构建(例如play 2.3.x)时,这会导致奇怪的问题。

此外,您正在使用JavaAppPackaging原型,但是已经启用了JavaServerAppPackaging原型。 这也可能导致某些奇怪的行为,如您的行为。

所以解决方案是

  • 将play 2.3.x升级到2.4.x
  • 或将sbt-native-packager降级到0.8.x

您也可以查看我们的文档进行游戏

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM