JDK-8023199 : JDK demo jfc/Java2D/Java2Demo.html needs to be updated after fix of JDK-8001167.
  • Type: Bug
  • Component: deploy
  • Affected Version: 7u40,8
  • Priority: P3
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2013-08-18
  • Updated: 2015-01-31
  • Resolved: 2014-10-15
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 8
8u40Resolved
Related Reports
Relates :  
Relates :  
Description
After JDK-8001167, JDK demo jfc/Java2D/Java2Demo.html no longer works because local applet could not get codebase and all operations related to it will fail.

Steps to reproduce:
1. install JRE 8b103
2. download demo from http://jre.us.oracle.com/java/re/jdk/1.8.0/promoted/latest/bundles/windows-i586/jdk-8-ea-bin-b103-windows-i586-demos-14_aug_2013.zip and unzip it somewhere to local disk
3. run demo jfc/Java2D/Java2Demo.html locally in browsers (you need to set security level to medium, otherwise it could not be run)
4. after accepting unsigned security dialog, if you see exception as below, then the issue is reproduced:
==========
java.lang.NullPointerException
    at sun.awt.SunToolkit.createImage(SunToolkit.java:798)
    at java2d.DemoImages.getImage(DemoImages.java:95)
    at java2d.DemoImages.newDemoImages(DemoImages.java:72)
    at java2d.Java2Demo.<init>(Java2Demo.java:140)
    at java2d.Java2DemoApplet.init(Java2DemoApplet.java:122)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:724)
===========

If you access the same page remotely, then it's working fine. - http://sqeweb.us.oracle.com/net/sqenfs-1/export1/comp/jsn/users/stephen/deployment_stuff/do.NOT.remove.me/jdk1.8.0/demo/jfc/Java2D/Java2Demo.html .

Suggested fix:
Now to load resource inside the applet jar, we could use getResoruceAsStream. Code like
========
img = ImageIO.read(cmp.getClass().getResourceAsStream("/images/" + name));
========

is working fine.


Comments
JDK-8025917 adds text to readme that some demo applets need to be accessed through the HTTP or HTTPS protocols to enable access to the required resources. Thus closing this as not an issue.
15-10-2014

SQE-OK to defer this issue to 7u60
22-08-2013

Once I see SQE-OK - I'll approve. Please update the fixedVersion field.
21-08-2013

defer request. The demos are part of the JDK and can't be fixed later in the release cycle. Not a release stopper.
21-08-2013