poidasmith / winrun4j

WinRun4J Java Application Launcher
http://winrun4j.sourceforge.net
212 stars 63 forks source link

Java VM exits but winrun4j does not terminate #79

Open kc7bfi opened 7 years ago

kc7bfi commented 7 years ago

I have a java desktop application that is launched using winrun4j. The java application exists and I see the message "Application exited" but I still see the executable in Task Manager. When I try to connect with jconsole or jvisualvm, it won't connect. I assume because Java has terminated. Any thoughts on what may be going on? David

bdw429s commented 5 years ago

@kc7bfi Did you ever get an answer on this? I noticed the same behavior that when my ServiceMain method returns, the service just keeps trucking even though nothing is running. Even if I throw an exception or return a non-zero value, the service stays running. The only way I found to work around it, was to set a boolean flag when the shutdown service signal was sent in my ServiceRequest method and then when my ServiceMain method got to the end, if the shutdown flag was still false, then I assume that something bad happened that killed my app other than a service stop signal, and I run

System.exit( 1 );

which seems to be the only way I can get the stupid service to actually stop. Sadly, it doesn't register as a failure so the Windows service restart policy never kicks in. See this ticket: https://github.com/poidasmith/winrun4j/issues/57

kc7bfi commented 5 years ago

No I did not. David

Best Regards,

David R Robison Senior Systems Engineer [Prometheus Logo - Email Signature]

From: Brad Wood notifications@github.com Sent: Tuesday, January 29, 2019 2:03 AM To: poidasmith/winrun4j winrun4j@noreply.github.com Cc: David Robison david.robison@psgglobal.net; Mention mention@noreply.github.com Subject: Re: [poidasmith/winrun4j] Java VM exits but winrun4j does not terminate (#79)

@kc7bfihttps://github.com/kc7bfi Did you ever get an answer on this? I noticed the same behavior that when my ServiceMain method returns, the server just keeps trucking even though nothing is running. Even if I throw an exception or return a non-zero value, the service stays running. The only way I found to work around it, was to set a boolean flag when the shutdown service signal was sent in my ServiceRequest method and then when my ServiceMain method got to the end, if the shutdown flag was still false, then I assume that something bad happened that killed my app other than a service stop signal, and I run

System.exit( 1 );

which seems to be the only way I can get the stupid service to actually stop. Sadly, it doesn't register as a failure so the Windows service restart policy never kicks in. See this ticket: #57https://github.com/poidasmith/winrun4j/issues/57

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/poidasmith/winrun4j/issues/79#issuecomment-458429831, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADFk3JWKdI3mDujH3QniZF7KZA7svA2Tks5vH_JAgaJpZM4NByLJ.

bdw429s commented 5 years ago

Thanks for the follow up @kc7bfi