gpt4 book ai didi

java - Procrun 日志 "missing Service ImageFile"(错误代码 1)

转载 作者:太空宇宙 更新时间:2023-11-04 10:41:01 64 4
gpt4 key购买 nike

我尝试使用 Apache Commons Procrun 将 JAR 文件安装为 Windows 服务。该服务已安装,但执行它会出现以下错误:

[2018-02-26 14:00:26] [info]  [38792] Starting service...
[2018-02-26 14:00:26] [error] [38792] Missing service ImageFile
[2018-02-26 14:00:26] [error] [38792] ServiceStart returned 1
[2018-02-26 14:00:26] [info] [38816] Run service finished.
[2018-02-26 14:00:26] [info] [38816] Commons Daemon procrun finished

我的配置看起来像(它在批处理文件中):

set SERVICE_NAME=Deamon
set BASE=c:\GIT\companyProject\myProject
set PR_INSTALL=%BASE%\deamon\prunsrv.exe

REM Service log configuration
set PR_LOGPREFIX=%SERVICE_NAME%
set PR_LOGPATH=c:\Logs\Deamon\logs
set PR_STDOUTPUT=c:\Logs\Deamon\stdout.txt
set PR_STDERROR=c:\Logs\Deamon\stderr.txt
set PR_LOGLEVEL=Error

REM Path to java installation
set PR_JVM=%BASE%\jre1.8.0_151\bin\java.exe
set PR_CLASSPATH=%BASE%\target\myProject.jar

REM Startup configuration
set PR_STARTUP=auto
set PR_STARTMODE=jvm
set PR_STARTCLASS=com.myProject.deamon.Main
set PR_STARTMETHOD=start

REM Shutdown configuration
set PR_STOPMODE=jvm
set PR_STOPCLASS=com.myProject.deamon.Main
set PR_STOPMETHOD=stop

REM JVM configuration
set PR_JVMMS=256
set PR_JVMMX=4000
set PR_JVMSS=8000
set PR_JVMOPTIONS=-Duser.language=DE;-Duser.region=de
REM Install service

deamon\%SERVICE_NAME%.exe //IS//%SERVICE_NAME%

SO 上也有类似的问题,但我找不到“缺少服务 ImageFile”错误的任何答案(也没有关于此主题的官方文档)。尽管我认为自己在编码方面有些经验,但我不知道这个错误从何而来。任何帮助将不胜感激。

最佳答案

我通过将以下内容添加到您的配置 service.bat 中解决了这个问题:

set PR_STARTIMAGE=C:\procrun\itiIcon.ico
set PR_STOPIMAGE=C:\procrun\itiIcon.ico

关于java - Procrun 日志 "missing Service ImageFile"(错误代码 1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48989375/

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