[英]Use ID of Play Server in a conf file included in 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原型。 這也可能導致某些奇怪的行為,如您的行為。
所以解決方案是
您也可以查看我們的文檔進行游戲
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.