admin管理员组文章数量:1026087
I am trying to setup a window service out of a spring boot fat jar using Apache Procrun. application is started successfully. But when I tried to stop the application by stopping the Windows service, it did not work. Spring boot 3.1.5 and 1.4.0.0 is the Apache procrun version.
Error logs from Apache Procurn :
[2024-11-17 21:06:45] [info] [20720] Service SERVICE_CONTROL_STOP signalled.
[2024-11-17 21:06:45] [info] [12804] Stopping service...
[2024-11-17 21:06:45] [error] [12804] Missing service ImageFile.
[2024-11-17 21:06:45] [error] [12804] The parameter is incorrect.
Procurn .bat :
@echo off
rem Set the path to the Java runtime
set JAVA_HOME=C:\Program Files\Java\jdk-21.0.1
rem Set the classpath for your Java application
set CLASSPATH=E:\USER\Other\Windows-service-R-D\sample.jar
rem Install the service using prunsrv
prunsrv //IS//XX ^
--Description "My Java Windows Service" ^
--Install "E:\USER\Other\Windows-service-R-D\prunsrv.exe" ^
--Jvm "%JAVA_HOME%\bin\server\jvm.dll" ^
--StartMode=jvm ^
--StartClass=.springframework.boot.loader.JarLauncher ^
--StartMethod main ^
--StopMode exe ^
--StopPath=E:\USER\Other\Windows-service-R-D\StopService.bat ^
--Classpath "%CLASSPATH%" ^
--LogPath="E:\USER\Other\Windows-service-R-D" ^
--LogPrefix=myapp ^
--Startup auto ^
--StdOutput "E:\USER\Other\Windows-service-R-D\stdout.txt" ^
--StdError "E:\USER\Other\Windows-service-R-D\stderr.txt"
StopService.bat:
@echo off
rem Use PowerShell to make a POST request
powershell -Command "Invoke-WebRequest -Uri http://localhost:7310/Sample/tf/turnOff -Method POST"
And I am able to stop my spring boot application by calling this StopService.bat from a cmd and PowerShell.
I am trying to setup a window service out of a spring boot fat jar using Apache Procrun. application is started successfully. But when I tried to stop the application by stopping the Windows service, it did not work. Spring boot 3.1.5 and 1.4.0.0 is the Apache procrun version.
Error logs from Apache Procurn :
[2024-11-17 21:06:45] [info] [20720] Service SERVICE_CONTROL_STOP signalled.
[2024-11-17 21:06:45] [info] [12804] Stopping service...
[2024-11-17 21:06:45] [error] [12804] Missing service ImageFile.
[2024-11-17 21:06:45] [error] [12804] The parameter is incorrect.
Procurn .bat :
@echo off
rem Set the path to the Java runtime
set JAVA_HOME=C:\Program Files\Java\jdk-21.0.1
rem Set the classpath for your Java application
set CLASSPATH=E:\USER\Other\Windows-service-R-D\sample.jar
rem Install the service using prunsrv
prunsrv //IS//XX ^
--Description "My Java Windows Service" ^
--Install "E:\USER\Other\Windows-service-R-D\prunsrv.exe" ^
--Jvm "%JAVA_HOME%\bin\server\jvm.dll" ^
--StartMode=jvm ^
--StartClass=.springframework.boot.loader.JarLauncher ^
--StartMethod main ^
--StopMode exe ^
--StopPath=E:\USER\Other\Windows-service-R-D\StopService.bat ^
--Classpath "%CLASSPATH%" ^
--LogPath="E:\USER\Other\Windows-service-R-D" ^
--LogPrefix=myapp ^
--Startup auto ^
--StdOutput "E:\USER\Other\Windows-service-R-D\stdout.txt" ^
--StdError "E:\USER\Other\Windows-service-R-D\stderr.txt"
StopService.bat:
@echo off
rem Use PowerShell to make a POST request
powershell -Command "Invoke-WebRequest -Uri http://localhost:7310/Sample/tf/turnOff -Method POST"
And I am able to stop my spring boot application by calling this StopService.bat from a cmd and PowerShell.
本文标签: windows servicesApache Procrun Failed to stop Spring boot fat jarStack Overflow
版权声明:本文标题:windows services - Apache Procrun Failed to stop Spring boot fat jar - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745629818a2160092.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论