[DAEMON] Procrun logging 'handle is invalid' errors when stopping service

"Strong, Jordan [DOH] via user" <[email protected]> Fri, 5 Dec 2025 19:46:11 +0000
Newsgroups gmane.comp.jakarta.commons.user
Message-ID <SA9PR09MB583875AD5D56E5FF8E364D2CC2A7A@SA9PR09MB5838.namprd09.prod.outlook.com>
--_000_SA9PR09MB583875AD5D56E5FF8E364D2CC2A7ASA9PR09MB5838namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I am using Procrun to run a Spring Boot microservice as a Windows service. =
After migrating from Spring Boot 2.7.18 to 3.3.11, I've observed that when =
Procrun stops the service, it now shows the following error messages in the=
 log:

[2025-12-05 08:50:02] [info]  [52656] Service SERVICE_CONTROL_STOP signalle=
d.
[2025-12-05 08:50:02] [info]  [27984] Stopping service...
[2025-12-05 08:50:02] [info]  [27984] Stopping service...timeout 60000
[2025-12-05 08:50:02] [info]  [27984] Stopping service...timeout 60000 _jni=
_shutdown
[2025-12-05 08:50:03] [error] [17164] Failed to set service status.
[2025-12-05 08:50:03] [error] [17164] The handle is invalid.

The service appears to have successfully shut down despite this, however. I=
've observed this happening with Procrun versions 1.4.1 and 1.5.0.

Interestingly, these errors aren't logged when I enable debug logging in Pr=
ocrun:

[2025-12-05 08:40:34] [info]  ( prunsrv.c:1610) [11696] Service SERVICE_CON=
TROL_STOP signalled.
[2025-12-05 08:40:34] [debug] ( prunsrv.c:1127) [11696] reportServiceStatus=
E: dwCurrentState =3D 3 (SERVICE_STOP_PENDING), dwWin32ExitCode =3D 0, dwWa=
itHint =3D 3000 milliseconds, dwServiceSpecificExitCode =3D 0.
[2025-12-05 08:40:34] [info]  ( prunsrv.c:1227) [ 9148] Stopping service...
[2025-12-05 08:40:34] [debug] ( javajni.c:419 ) [ 9148] Loaded JVM DLL 'C:\=
Program Files\Java\jdk-21.0.7+6\bin\server\jvm.dll', home '(null)'.
[2025-12-05 08:40:35] [debug] ( javajni.c:424 ) [ 9148] JNI_GetCreatedJavaV=
Ms...
[2025-12-05 08:40:35] [debug] ( javajni.c:1008) [12816] argv[0] =3D stop
[2025-12-05 08:40:35] [debug] ( javajni.c:1067) [12816] Java worker thread =
started for ***:stop
[2025-12-05 08:40:35] [debug] ( javajni.c:1073) [12816] JNI calling static =
void method ***:stop
[2025-12-05 08:40:35] [debug] ( javajni.c:571 ) [12204] Exit hook with exit=
 code 0
[2025-12-05 08:40:35] [debug] ( prunsrv.c:1194) [12204] Stop exit hook call=
ed...
[2025-12-05 08:40:35] [debug] ( prunsrv.c:1127) [12204] reportServiceStatus=
E: dwCurrentState =3D 1 (SERVICE_STOPPED), dwWin32ExitCode =3D 0, dwWaitHin=
t =3D 0 milliseconds, dwServiceSpecificExitCode =3D 0.
[2025-12-05 08:40:35] [debug] ( prunsrv.c:1203) [12204] Start exit hook cal=
led...
[2025-12-05 08:40:35] [debug] ( prunsrv.c:1204) [12204] JVM exit code: 0.
[2025-12-05 08:40:35] [debug] ( prunsrv.c:1127) [12204] reportServiceStatus=
E: dwCurrentState =3D 1 (SERVICE_STOPPED), dwWin32ExitCode =3D 0, dwWaitHin=
t =3D 0 milliseconds, dwServiceSpecificExitCode =3D 0.
[2025-12-05 08:40:35] [info]  ( prunsrv.c:1932) [11696] Run service finishe=
d.
[2025-12-05 08:40:35] [info]  ( prunsrv.c:2190) [11696] Apache Commons Daem=
on procrun finished.

Thank you,
Jordan Strong

Confidentiality Notice: This e-mail, including any attachments, may include=
 advisory, consultative and/or deliberative material and, as such, would be=
 privileged and/or confidential and not a public document. Any information =
in this e-mail identifying a client of the Department of Health or includin=
g protected health information is confidential. If you received this e-mail=
 in error, you are not authorized to review, transmit, convert to hard copy=
, copy, or in any way further use or disseminate this e-mail or any attachm=
ents to it. You must immediately notify the sender, delete the email/attach=
ment(s), confirm in writing to the sender that you deleted the email/attach=
ment(s) and that you did not/will not further use or disclose the informati=
on contained in the email.

--_000_SA9PR09MB583875AD5D56E5FF8E364D2CC2A7ASA9PR09MB5838namp_--