我试图将Spring Cloud Dataflow作为Windows服务启动。为此,我从here(版本winsw
)下载了2.1.2
。我的配置文件如下所示:
<configuration>
<id>my-id</id>
<name>my-name</name>
<executable>java</executable>
<startargument>-cp</startargument>
<startargument>spring-cloud-dataflow-server-local-1.2.2.RELEASE.jar;cp/*</startargument>
<startargument>org.springframework.boot.loader.JarLauncher</startargument>
<startargument>--spring.profiles.active=productin</startargument>
</configuration>
运行此命令后:
myApp.exe install (it's renamed winsw.exe)
myApp.exe start
我在日志文件中找到了这个:
2017-12-05 09:48:54,459 INFO - Starting ServiceWrapper in the service mode
2017-12-05 09:48:54,485 DEBUG - Completed. Exit code is 0
2017-12-05 09:48:54,500 INFO - Starting java -cp spring-cloud-dataflow-server-local-1.2.2.RELEASE.jar;cp/* org.springframework.boot.loader.JarLauncher --spring.profiles.active=production
2017-12-05 09:48:54,500 INFO - Starting java -cp spring-cloud-dataflow-server-local-1.2.2.RELEASE.jar;cp/* org.springframework.boot.loader.JarLauncher --spring.profiles.active=production
2017-12-05 09:48:54,515 DEBUG - Completed. Exit code is 0
没有任何反应......服务器没有运行,没有更多的日志。如果我尝试从控制面板&gt;运行它服务,我收到服务已经开始但随后停止的信息。
如何正确运行Spring Boot应用程序作为Windows服务?