Service can not be stopped
Status: Abandoned
Brought to you by:
timothydk
In Janel 4.1.0 a java program installed as a service can not be stopped/uninstalled any more. The static method initiateExit in the main class is no longer called and so the program is not informed about the stopping request.
This worked in the former version 4.0.4.
We are working with 32 bit java 1.8.0_60 on Windows 7 machines here.
You will find a configuration file for the service as an attachment.
Hi Roland,
Please use Janel 4.0.4 until this is resolved.
Thanks,
Tim
I think I see where I introduced that bug:
https://bitbucket.org/jdstroy/janel/src/e6915337d48dc5471471e3dc97fd389fbcfdde1d/JVMLauncher.cpp?at=default&fileviewer=file-view-default#JVMLauncher.cpp-90
I forgot to copy output into buff. I'll try to fix that this weekend.
I think this should fix it:
https://bitbucket.org/jdstroy/janel/commits/457292906f17acb81d9f12cd3c24d86340bf5e5e
Thank you John! Your changes are in Janel 4.1.1.
Thank you Roland for reporting this! Let us know if Janel 4.1.1 does not fix the issues you experienced.
Tim
I tried Janel 4.1.1. Now the service can be installed, but not started. I did the following:
C:\TEMP\CORECUSTOMER>bin\coreserver_service.exe --install
C:\TEMP\CORECUSTOMER>sc start wms_coreserver
[SC] StartService FEHLER 1053:
Der Dienst antwortete nicht rechtzeitig auf die Start- oder Steuerungsanforderung.
Which means:
Error 1053: The service did not respond to the start or control request in a timely fashion
Replaced the executable with the one from janel-4.0.4 everything works fine.
The configuration (coreserver_service.lap) is still the same as in the original post, but now I uncommented the line containing the WMS_JAVA_HOME environment variable and set the environment variable to the correct path.
Hi Roland,
I have three tests that I ran with 4.1.1 which start a Windows service and write out to a file. All three tests ran successfully. Have you tried starting any other Windows services with Janel than the current one you have issues with? In the Janel zip file I have TestLaunch046.java, TestLaunch047.java and TestLaunch048.java that can be used as Windows services, if you would like to try one of these out to see if it can be started. I would recommend trying TestLaunch048 first, it runs for 2 minutes before stopping by itself.
Tim
Hi Timothy,
I did some more experiments. The problem seems to be related to the
janel.java.home_path
property in conjunction with an environment variable.My .lap file contains the following line:
janel.java.home.path=${env.WMS_JAVA_HOME}
I found out the following:
If I set the environment variable WMS_JAVA_HOME at the command line, The service can be installed, and uninstalled, but not started (see Session 1 log). This behavior is different in janel 4.0.4 (maybe a fallback to an appropriate java version or the environment variable has been evaluated during installation of the service?).
If I comment out the
janel.java.home.path
, everything works fine. The service can be installed, started, stopped and uninstalled correctly (see Session 3 log)If I replace the environment variable in the .lap file by a fixed path (
janel.java.home.path=C:\Program Files (x86)\Java\jdk1.8.0_60janel.min.java.version=1.8
), everything works fine (see Session 4 log).Session 1 log (WMS_JAVA_HOME set in System Control Panel):
Session 2 log (WMS_JAVA_HOME set from command line):
Session 3 log (janel.jave.home.path commented out):
Session 4 log (Fixed path instead of environment variable):
Don't know if this behavior is intended and if you regard this as a bug or not. Anyway, I would prefer to set the environment variable in a start-script (Batch-File) instead of depend on a system-wide setting.
Thank you very much for your help and work so far.
Hi Roland,
You are going to need to use a system-wide environment variable for your service to start. Since an environment variable set at the command prompt disappears for that user as soon as the command prompt disappears, and starting a service could happen from any command prompt and from the Windows service management console - and a Janel Windows service refers to the .lap file for starting and stopping at start and stop time, it really has to be a system-wide environment variable.
Tim
Hi Tim,
Thats understandable and OK for me. IMHO You can close this bug now.Thank you very much.
You're welcome!
Tim