2015-12-02 106 views
1

我試圖按照如何將Play Framework 2.4.4應用程序作爲Windows服務運行?

How do I run a Play Framework 2.0 application as a Windows service?

中描述的步驟,我失敗在第5步 起初的服務表現有關

play.core.server.NettyServer錯誤

腳本的一部分。 我改成了

play.core.server.ProdServerStart

但現在我得到運行的start.bat一個錯誤說

C:\GCS>java -cp "C:\GCS\lib\*" play.core.server.ProdServerStart 
Oops, cannot start the server. 
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] 
     at play.api.Configuration$.configError(Configuration.scala:178) 
     at play.api.Configuration$.load(Configuration.scala:103) 
     at play.api.Configuration$.load(Configuration.scala:133) 
     at play.api.ApplicationLoader$.createContext(ApplicationLoader.scala:91) 
     at play.core.server.ProdServerStart$.start(ProdServerStart.scala:50) 
     at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27) 
     at play.core.server.ProdServerStart.main(ProdServerStart.scala) 
Caused by: com.typesafe.config.ConfigException$IO: 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 
     at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:236) 
     at com.typesafe.config.impl.ConfigImpl.parseResourcesAnySyntax(ConfigImpl.java:132) 
     at com.typesafe.config.ConfigFactory.parseResourcesAnySyntax(ConfigFactory.java:1024) 
     at com.typesafe.config.ConfigFactory.parseApplicationConfig(ConfigFactory.java:238) 
     at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:519) 
     at play.api.Configuration$$anonfun$3.apply(Configuration.scala:75) 
     at play.api.Configuration$$anonfun$3.apply(Configuration.scala:71) 
     at scala.Option.getOrElse(Option.scala:121) 
     at play.api.Configuration$.load(Configuration.scala:71) 
     ... 5 more 
Caused by: com.typesafe.config.ConfigException$IO: application.conf: java.io.IOException: resource not found on classpath: application.conf 
     at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:188) 
     at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174) 
     at com.typesafe.config.impl.Parseable.parse(Parseable.java:152) 
     at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:185) 
     ... 13 more 
Caused by: java.io.IOException: resource not found on classpath: application.conf 
     at com.typesafe.config.impl.Parseable$ParseableResources.rawParseValue(Parseable.java:735) 
     at com.typesafe.config.impl.Parseable$ParseableResources.rawParseValue(Parseable.java:710) 
     at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180) 
     ... 16 more 

我找了一個解決方案對於這個無處不在,但找不到任何。

我想其他的東西已經改變了,因爲原來的答案被給出了dist。

任何人都知道可能是什麼問題?

回答

4

您需要配置。也就是類路徑。取決於您的conf的位置,嘗試類似以下(未經測試):

java -cp ".conf;.;lib/*" play.core.server.ProdServerStart 
+0

工作就像一個魅力。 – Elliko

相關問題