Open lafual opened 6 years ago
@lafual Did you get this resolved? I am looking into winrunj as a replacement for launch4j specifically so I can create Windows services out of the binary without using a wrapper tool such as NSSM. Are you saying that the binaries produced by winrunj are not suitable to call directly via a windows service?
Hi. Received no update as to whether it is fixed. I evaluated most of what is available. I found Tanuki and JSL to be the best, in that an uncaught java exception will fail the service and cause a windows events. Yajsw and procrun are also ok, but they never fail the windows service, so you may never know that you have a problem. Winsw also looked promising, but seems to kill the jvm and not run the ShutdownHook
@lafual Wow, thanks for the run down. It will help me narrow the list.
You are welcome. A small correction about my comment on winsw; when you stop the windows service via sc or the gui, i think winsw gives the wrong kill to the jvm and the shutdown hook doesnt run. Tanuki is free for 32bit, not 64. So ended up using JSL from source forge.
Using Windows Server 2016 with Java 8 64bit. My Java class does not extend the WinRun4J classes and is a plain
public static void main(String[])
with aShutDownHook
. INI hasservice.mode=false
and bothmain.class
andservice.class
refer to the samemain
.When starting as a Window Service, the Java is run and I see the expected output in the logs. However, the Windows Service "Starting" progress bar remains open for about 15 seconds, then reports Error 1053: The service did not respond to the start or control request in a timely fashion. At which point, the EXE is stopped and Java
ShutDownHook
is run (this output is logged too).It looks like WinRun4J is not reporting the started event to Windows.