Peter R
Posts: 16
Joined: Tue Oct 31, 2006 6:36 pm

Java service fails on Windows 2003

We distribute a Java application as a regular (GUI) application and as a service. The GUI application never has crashed so far. However, the service terminates unexpectedly from time to time on some machines. Usually, simply restarting automatically works.

However, two users have reported that the service stops unexpectedly when logging out of Windows 2003 Server. We have been able to reproduce this on our 2003 Server test virtual machine. The event log shows error ID 7034.

The program listens to UPD and TCP connections on several ports. The problem exists even when the Firewall is turned off, and no anti-virus software is running. All current updates are applied.

Any help about how to fix this problem, or how to debug it, would be appreciated. The event log entries give no information. We log the "stop()" call in our software to a file; they do not get called when the service stops (or rather, crashes) at logout.
Cristi
Posts: 34
Joined: Wed Oct 08, 2008 8:44 am
Contact: Website

Re: Java service fails on Windows 2003

Hi,
However, the service terminates unexpectedly from time to time on some machines.
I think it might be a problem with your Java application. Please make sure that it does not consume completely a resource after longtime run, like memory for instance.
We log the "stop()" call in our software to a file; they do not get called when the service stops (or rather, crashes) at logout.
We can not reproduce this behavior on our test machine. Can you please send us the .AIP (project) you are using to support at advancedinstaller dot com so we can investigate the problem?

Best regards,
Cristi
______________________________
Cristi Costache
Advanced Installer Team
http://www.advancedinstaller.com/
Peter R
Posts: 16
Joined: Tue Oct 31, 2006 6:36 pm

Re: Java service fails on Windows 2003

I think it might be a problem with your Java application. Please make sure that it does not consume completely a resource after longtime run, like memory for instance.
That is definitely not the cause of the problem. The particular application is not resource intensive. We have not seen any crashes on our machines, except when related to logoffs. It is quite possible that the other crashes were also logoff related (they were reported to us indirectly).
We can not reproduce this behavior on our test machine.
We had not found it in our initial testing, either, and only very few customers have reported it so far. Turns out that this happens when the last user logs out, and only on XP and 2003 server, but not on Vista. The machines that we saw this behavior on were virtual machines under different flavors of VMWare and Parallels; however, I do not believe that this is relevant (virtual Vista machines did not show the behavior).

The source of the problem was that the JVM received TERM signals, and then exited. The fix is to add the JVM option -Xrs to the .ini file for the service. Another option that also works is to register a signal handler that receives the TERM signal, and ignores it. Either solution works on all machines tested, using JVMs from 1.4.12 to the current Java 6 VMs.

You may want to update your Java service tutorial to point out the need to add either the command line flag or to handle the TERM signal in the code.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Java service fails on Windows 2003

Hi,

Thank you for presenting the solutions for this problem. For the next version of Advanced Installer we will update the appropriate help articles.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”