gpt4 book ai didi

windows - 如何将 Play Framework 2.4.4 应用程序作为 Windows 服务运行?

转载 作者:可可西里 更新时间:2023-11-01 11:17:28 24 4
gpt4 key购买 nike

我正在尝试按照

中描述的步骤进行操作

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 的构建方式发生了其他变化。

谁知道可能是什么问题?

最佳答案

您需要配置。在类路径上,即。根据您的 conf 所在的位置,尝试以下操作(未经测试):

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

关于windows - 如何将 Play Framework 2.4.4 应用程序作为 Windows 服务运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34039869/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com