Java Service with embedded JAR hangs on stop operation with 13.5 - Advanced Installer Community
pdressler
Posts: 4
Joined: Fri Dec 23, 2016 2:48 pm

Java Service with embedded JAR hangs on stop operation with 13.5

Hello,
we have a Java Main Claas configured as a service according to your documentation with a stop() method.
Also there is a stop(boolean), that is called by the stop() method.

Since we have been switched from our previously used advanced installer version 13.3 to 13.5 we can reproduce, that our service often does not respond to the 'Stop' action in the service window.
The same behaviour can be reproduced during the uninstall of our service as the service will be stopped on uninstallation.
With the installers built by advanced installer 13.3 we do not have any problems.

The behaviour can be reproduced on machines with Windows 7 and SP1 installed.

Do you have any idea how to fix that?

Best regards
Philipp
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java Service with embedded JAR hangs on stop operation with 13.5

Hello Philipp,

I've tested the scenario, but I cannot replicate the behavior. Can you please send us the .AIP (project file) and a download link of your JAR file used for your Java Service to support at advancedinstaller dot com so we can investigate them?

If you cannot share with us your project file, then you can try to isolate the behavior in a buildable sample (.aip + its referenced files) which we can build and test on our side.

Also, as a side note, can you give a trial to our sample attached in our "Creating a Java Service Installation" tutorial and see if the same behavior occurs?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pdressler
Posts: 4
Joined: Fri Dec 23, 2016 2:48 pm

Re: Java Service with embedded JAR hangs on stop operation with 13.5

Hello Daniel,
thanks for your support.
The problem has been solved.

We have tested the example from the tutorial with the given JAR and the example with our JAR file. The behavior could only replicated with our product.
Our product has a client/server architecture with a service and a GUI application on the same machine, that are communicating with TCP sockets.

It turns out that the problem occured, because one of the sockets in the service application was not closed correctly.

As builds with the advanced installer 13.3 have been worked, I think the advanced installer 13.5 handles the situation differently. So it hangs on the stop operation of the service if there is an open socket. The advanced installer 13.3 did not.

The problem has been solved on our side, as we are now closing the open socket connection, which we have opened just before stopping the service (within the stop() method call).

Once again thank you for your support.

Best wishes,
Philipp
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java Service with embedded JAR hangs on stop operation with 13.5

You're always welcome Philipp.

I'm glad you sorted things out.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”