JDK-8020211 : first webstart start with pack200 jars sets the wrong timezone
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 7u25
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • Submitted: 2013-07-04
  • Updated: 2015-06-19
  • Resolved: 2015-06-19
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 Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version  " 1.7.0_25 " 
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
Linux platform 3.5.0-25-generic #39~precise1-Ubuntu SMP Tue Feb 26 00:07:14 UTC 2013 x86_64 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
We provide an webstart application which is downloaded with pack200
packed jars.
There a multiple jars referenced in the jnlp.
The first time the app is downloaded the timetone on the client is
not same like defined on the client system.
On the second start of the app (no download of jars) the timezone is correct.
When we delete the local application in java control panel the occurs again.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- put the provided main (see source code) into a signed pack200 jar.
- create some dummy jars with data an different sizes an provide them also in the jnlp
(also signed and packed, see example jnlp in source code). in my tests i needed about 10 jars to reproduce the problem consistently.
- the jars have to be bigger then the jar with the main class.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
TimeZone property: Europe/Berlin
TimeZone.getDefault(): sun.util.calendar.ZoneInfo[id= " Europe/Berlin " ,offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]

ACTUAL -
TimeZone property: Europe/Berlin
TimeZone.getDefault(): sun.util.calendar.ZoneInfo[id= " UTC " ,offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public static void main(String[] args) {
System.out.println( " TimeZone property:  "  + System.getProperty( " user.timezone " ));
System.out.println( " TimeZone.getDefault():  "  + TimeZone.getDefault());
}

<?xml version= " 1.0 "  encoding= " utf-8 " ?>
<jnlp spec= " 1.0+ "  codebase= " http://localhost:40000/ulcjnlp " >
  <information>
    <title>ABACUS</title>
    <vendor>ABACUS Research AG</vendor>
    <homepage href= " http://www.abacus.ch " />
    <icon href= " http://localhost:40000/ulc/aba.jpg " />
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <jar href= " http://localhost:40000/ulc/lib/signed_Dummy1.jar " />
    <jar href= " http://localhost:40000/ulc/lib/signed_TimeZoneBug.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy2.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy3.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy4.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy5.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy6.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy7.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy8.jar " />
<jar href= " http://localhost:40000/ulc/lib/signed_Dummy9.jar " />
  </resources>
  <application-desc main-class= " ch.abacus.java_bugs.Pack200WebStartTimeZoneBug " />
</jnlp>

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
put the following code into the first line of the main method:

  final String zoneID = System.getProperty( " user.timezone " );
        if(!TimeZone.getDefault().getID().equals(zoneID)) {
            TimeZone.setDefault(TimeZone.getTimeZone(zoneID));
        }
Comments
The issue was fixed in jdk7 and 8 by JDK-8066985, in jdk 9 it will be fixed by JDK-8073187
19-06-2015