我正在尝试启动作为Windows服务的Spring引导应用程序。我使用Apache procrun来实现它。
我的文件夹结构是:
|-C:\BillWeb
| |-- BW3
| |- BillWeb-0.0.1-SNAPSHOT.jar
| |
| public
| |- here place for static files (index.html... etc..)我安装服务的命令是:
prunsrv.exe //IS//BillWeb3 --DisplayName="BillWeb-RKCDB2" --Description="BillWeb of RKCDB2" --Startup=auto --Install=C:\BillWeb\prunsrv.exe --Jvm=auto --JvmMx=3500 --Classpath=C:\BillWeb\BW3\BillWeb-0.0.1-SNAPSHOT.jar --StartMode=Java --StartClass=com.ric.web.Bootstrap --StartMethod=start --StartParams=start --StopMode=Java --StopClass=com.ric.web.Bootstrap --StopMethod=stop --StopParams=stop --StdOutput=auto --StdError=auto --LogPath=C:\BillWeb\BW3\ --LogLevel=Debug该服务运行良好,但是Spring boot不能看到用于web访问的静态文件文件夹。
http://192.168.100.200:8084/index.html <- not accessible但是当我使用下面的代码时,我的服务成功地找到了静态文件:
cd C:\BillWeb\BW3
java -jar -Duser.language=en -Duser.region=us BillWeb-0.0.1-SNAPSHOT.jar我如何纠正这个问题?
发布于 2017-05-12 15:39:53
--StartPath Working path for the start image executable.我必须添加--StartPath参数来安装服务,如下所示:
prunsrv.exe //IS//BillWeb3 --StartPath=C:\BillWeb\BW3\ --DisplayName="BillWeb-RKCDB2" ...它完全解决了我的问题。
https://stackoverflow.com/questions/43912076
复制相似问题