JDK-6814234 : jnlp_file/appletDesc/index.html#misc fails starting from jdk 6u13 b02
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6u13
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-03-06
  • Updated: 2011-01-19
  • Resolved: 2009-03-16
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 6
6u13 b03Fixed
Related Reports
Relates :  
Description
TCK JNLP       : 6.0 b03
J2SE           : FAIL - jdk 6u13 b02
Platform[s]    : FAIL - any
switch/Mode    : FAIL - default

appletDesc2003 testcase of the jnlp_file/appletDesc/index.html#misc tck-jnlp test fails (starting from 6u13 b02) with a message:

====== appletDesc2001 ====== param
====== appletDesc2002 ====== codebase
====== appletDesc2003 ====== documentbase
CodeBase() returns:file:////export/home/stt-robot/.java/deployment/cache/6.0/23/51b30b57-7ba9f1aa. But should be http://stt-71:56761/jnlp_file/appletDesc/index.html
====== appletDesc2004 ====== sizes

----------log:(7/205)----------
  
test cases: 4; passed: 3; failed: 1; first test case failure:
appletDesc2001: Passed. OKAY
appletDesc2002: Passed. OKAY
appletDesc2003: Failed. Incorrect document base value
appletDesc2004: Passed. OKAY

Please see *.jtr in comments.

The problem is incorrect work of getDocumentBase()
It can be reproduced with the fillowing simple appet and tck jnlp file.
IMPORTANT NOTE!!
With this applet problem is reproducible in 6u12, 6u13 and 6u14, but tck-jnlp test fails only for 6u13 b02. 
This strange behaiviour I can't explain, I only suspect that integration of 6802069 changed something that stressed getDocumentBase() behaiviour and made test failing.

Steps to reproduce:
1. Install jdk 6u13 b02 (for example to /export/jdk/jdk1.6.0_13)
2. Compile and prepare jar file for this applet:
import java.awt.*;
import java.applet.*;

public class Clock extends Applet {
    public void init() {
        System.out.println("getDocumentBase() returns: " + getDocumentBase() + "" );
    }
}
3. Write *.jnlp file (it could be found at  http://stt-13/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/test2.jnlp or /net/stt-13.russia.sun.com/export/home0/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/test2.jnlp)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2002 Sun Microsystems, Inc. All rights reserved.-->
<!-- SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.-->
<jnlp spec="0.2+"
  codebase="http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/">
  <information>
    <title>Test</title>
    <vendor>Sun Microsystems, Inc.</vendor>
  </information>

  <resources>
    <j2se version="1.6"/>
    <jar href="clock.jar"/>
  </resources>
  <applet-desc
        main-class="Clock"
        name="AppletTest"
        documentbase="index.html"
        width="100"
        height="100">
        <param name="codebase" value="http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/"/>
  </applet-desc>

</jnlp>
4. Place this file in web accesible location (files needed to run could be found in http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/)
5. Open Java Control Panel and enable logging and opening console.
6. Run command like /export/jdk/jdk1.6.0_13/bin/javaws http://stt-13/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/test2.jnlp

You will see message 
getDocumentBase() returns: file:////export/home/stt-robot/.java/deployment/cache/6.0/9/3b84c309-7ed84886

If you change *.jnlp file to 
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2002 Sun Microsystems, Inc. All rights reserved.-->
<!-- SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.-->
<jnlp spec="0.2+"
  codebase="http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/">
  <information>
    <title>Test</title>
    <vendor>Sun Microsystems, Inc.</vendor>
  </information>

  <resources>
    <j2se version="1.6"/>
    <jar href="clock.jar"/>
  </resources>
  <applet-desc
        main-class="Clock"
        name="AppletTest"
        width="100"
        height="100">
        <param name="codebase" value="http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/"/>
  </applet-desc>

</jnlp>

i.e. without documentbase="index.html"
Message will be 
getDocumentBase() returns: http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/clock.jarjnlp
which is also incorrect I believe.

With 6u11 messages will be
getDocumentBase() returns: http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/index.html
and 
getDocumentBase() returns: http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/
respectively.

If you use jdk 6u12, 6u13 (not b02), 6u14 additional message will appear in the logs:
java.lang.InternalError:
****************************************************************
ERROR: the javaplugin.version system property wasn't picked up
by the com.sun.deploy.Environment class. This probably happened
because of a change to the initialization order in PluginMain
where the deployment classes are being initialized too early.
This will break jar cache versioning, and possibly other things.
Please undo your recent changes and rethink them.
****************************************************************

(see http://stt-13.russia.sun.com/results/1.6.0_13/b02/JNLP6/jnlp-rhel5.2_x86-i586_client_mixed/rerun/log3/javaws6104550187538582002.log)

Evaluation is required. If you believe I messed up 2 bugs in this CR I'll file separate one for getDocumentBase().

Comments
EVALUATION javaws launcher fails to pass in documentbase and codebase to JNLP2Viewer.
06-03-2009