JDK-6631056 : SingleInstanceService does not work on JRE 1.6.0_03
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-11-16
  • Updated: 2011-02-16
  • Resolved: 2007-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 6
6u10 b09Fixed
Description
FULL PRODUCT VERSION :
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Versione 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Internet Explorer 7 or Firefox 2.0

A DESCRIPTION OF THE PROBLEM :
The SingleInstanceService does not work correctly on JRE version 1.6.0_03, while it worked fine with previous versions of the JRE, including JRE version 1.6.0_02.

Launching multiple times the JNLP of a Java Web Start application which register itself as a SingleInstanceListener causes multiple instances of that application to be launched. This is an incorrect behavior. The correct behavior would be that subsequent calls to the JNLP file of a "single instance application" shall cause the existing instance to be notified through a call to the newActivation(...) method, instead of opening a new instance.
With JRE version 1.6.0_03, the correct behavior can be obtained only in rare "random" occasions.

The same "single instance" application always works correctly if run with JRE version 1.6.0_02: in this case, a single instance of the application exists, and that instance is notified in case of several calls to the JNLP file.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On a machine where JRE v1.6.0_03 is installed, try loading several times the following URL through your web browser (I used both IE 7 and Firefox 2.0, with the same result):

http://www.physci.org/jws/singleapp.jnlp

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Only a single instance of the Java Web Start application should be open, and it shall get notified when subsequent calls to the JNLP are made.
ACTUAL -
Most often, multiple instances of the test Java Web Start application get opened.

REPRODUCIBILITY :
This bug can be reproduced often.

---------- BEGIN SOURCE ----------
See:

<http://www.physci.org/jws/singleapp.zip>

Source code by Andrew Thompson.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Use an older JRE version.
For instance, JRE version 1.6.0_02 is working fine from this point of view.

Release Regression From : 6u2
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION I can reproduce the problem when the I host the testcase on my own server. Problem might be caused by memory corruption in the native single instance code. we are only calling strncpy with the correct arguments.
2007-11-19