JDK-6392182 : REGRESSION: Applets fail to load
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2006-03-01
  • Updated: 2014-02-27
  • Resolved: 2006-04-27
Description
J2SE Version (please include all output from java -version flag):
  java version "1.5.0_06"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
  Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

  and java version "1.6.0-beta2"

  Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta2-b73)
  Java HotSpot(TM) Client VM (build 1.6.0-beta2-b73, mixed mode, sharing)

Does this problem occur on J2SE 1.4.x or 5.0.x ?  Yes / No (pick one)
  no on 1.4.x, yes on 5.0u6

Operating System Configuration Information (be specific):
   Microsoft Windows 2000 [Version 5.00.2195]

Hardware Configuration Information (be specific):
  Pentium 4

Bug Description:
  Regression: Applets fail to load

  Under this configuration (other configurations seem to work) all Applets I have tried now fail 
  to load (using older JDKs they were loading before) I have found others with the same problem:

      http://forums.java.net/jive/thread.jspa?messageID=34805

For example using a Sun Applet:
http://java.com/en/download/help/testvm.xml

gives the error:
load: class testvm.class not found.
java.lang.ClassNotFoundException: testvm.class
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    at sun.applet.AppletClassLoader.access$100(Unknown Source)
    at sun.applet.AppletClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 10 more

I 1st noticed this with build 1.6.0-beta2-b73 then went back to 1.5.0_06 and the problem was 
still there. It would be nice if the Java Plug in would let us pick with JRE to use without us
needing to uninstall and reinstall each one. I tested using both Mozilla Firefox and IE and 
they both have the same problem.

Firefox and JRE 1.5.0_06 trace level 5 output:
---------------------------------------------------
basic: Registered modality listener
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@1bf6770, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@1c5fde0
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
network: Connecting http://java.com/applet/testvm.class with proxy=DIRECT
network: Connecting http://java.com/applet/testvm.class with cookie
"JSESSIONID=7637A509FDD4B9C63CB7D309B680E252.tomcat2; s_cc=true;
s_sq="
network: Connecting http://java.com/applet/testvm/class.class with proxy=DIRECT
network: Connecting http://java.com/applet/testvm/class.class with
cookie "JSESSIONID=7637A509FDD4B9C63CB7D309B680E252.tomcat2;
s_cc=true; s_sq="
load: class testvm.class not found.
java.lang.ClassNotFoundException: testvm.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
basic: Exception: java.lang.ClassNotFoundException: testvm.class


Internet Explorer and JRE 1.5.0_06 trace level 5 output:

basic: Registered modality listener
liveconnect: Invoking JS method: document
liveconnect: Invoking JS method: URL
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@1db4f6f, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@65a77f
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
network: Connecting http://java.com/applet/testvm.class with proxy=DIRECT
network: Connecting http://java.com/applet/testvm.class with cookie
"JSESSIONID=3776D4F9A1D53E6C9F225C0F2DA46281.tomcat4"
network: Connecting http://java.com/applet/testvm/class.class with proxy=DIRECT
network: Connecting http://java.com/applet/testvm/class.class with
cookie "JSESSIONID=3776D4F9A1D53E6C9F225C0F2DA46281.tomcat4"
load: class testvm.class not found.
java.lang.ClassNotFoundException: testvm.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
basic: Exception: java.lang.ClassNotFoundException: testvm.class
test result from the appletviewer:

C:\Program Files\Java\jdk1.6.0\bin>appletviewer http://java.com/en/download/help/testvm.xml
load: class testvm.class not found.
java.lang.ClassNotFoundException: testvm.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:183)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:127)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:626)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:760)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:689)
        at sun.applet.AppletPanel.run(AppletPanel.java:361)
        at java.lang.Thread.run(Thread.java:626)
Caused by: java.io.IOException: open HTTP connection failed.
        at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:286)
        at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:44)
        at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:173)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:170)
        ... 8 more

C:\Program Files\Java\jdk1.6.0\bin>java -version
java version "1.6.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta2-b73)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b73, mixed mode, sharing)

The applet viewer opens up and says start: applet not initialized.

As a side note I have tested on JDKs as far back as 1.4.0 and they no longer work either.  Seems that something has become corrupted and so this might not be a regression.  I had installed JRE build 1.6.0-beta2-b73 before the problem started to occur.

Also I have since found another applet that still works.  So it isn't all Applets with the problem.

Another of the Applets that no longer works (tested on 1.5.0_06 and 1.6.0-beta2-b73) also reports java.lang.Error: java.lang.ClassNotFoundException so it would seem to be the same problem.  I am sure that this other Applet is using Class.forName(...) as it is finding other classes, but not the required one which is a constructed name.  This Applet was working on earlier JREs including 1.5.0_06 on this computer and is still working on JRE 1.5.0_06 on another computer.
Here is the trace from a different computer where it works fine:

Java Plug-in 1.5.0_06
Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Yoseph Phillips
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
basic: Stopping applet ...
basic: Removed progress listener: sun.plugin.util.GrayBoxPainter@aa9835
basic: Finding information ...
basic: Releasing classloader: sun.plugin.ClassLoaderInfo@1bf6770, refcount=0
basic: Caching classloader: sun.plugin.ClassLoaderInfo@1bf6770
basic: Current classloader cache size: 1
basic: Done ...
basic: Joining applet thread ...
basic: Destroying applet ...
basic: Disposing applet ...
basic: Quiting applet ...
basic: Joined applet thread ...
basic: Unregistered modality listener
basic: Registered modality listener
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@1bf6770, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@982589
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
TestVM 3.1 kc
Copyright (c) 2005 Sun Microsystems, Inc.
All Rights Reserved.
basic: Loaded image: http://java.com/en/img/download/t1.gif
basic: Loaded image: http://java.com/en/img/download/t2.gif
basic: Loaded image: http://java.com/en/img/download/t3.gif
basic: Loaded image: http://java.com/en/img/download/t4.gif
basic: Loaded image: http://java.com/en/img/download/t5.gif
basic: Loaded image: http://java.com/en/img/download/t6.gif
basic: Loaded image: http://java.com/en/img/download/t7.gif

I am a little puzzled how this helps you, but seems to be what you asked for.  
I wont change this system to Mustang as I am scared about corrupting it.
This is obviously a very serious problem for me, so I'll do what you need.

Comments
EVALUATION Customer reported this is a configuration issue in their side, because: 1. It was blocked on the Cisco Firewall feature set on the router 2. unblocked by adding the following lines to the router: ip inspect name myfw http java-list 10 access-list 10 permit any They can access sun applet now.
27-04-2006

EVALUATION Test results from the submitters: ----------------------------- renamed the deployment.properties and tested with mustang without success. renamed the deployment.properties and tested with 1.5.0 without success. even tried deleting everything under Sun/Java and still no success. Each time the deployment.properties was recreated and each times got the same error messages in the java console.
29-03-2006

EVALUATION We should look at the code that constructs the URL to load. This URL from the code appears to have been constructed improperly and is suspect... http://java.com/applet/testvm/class.class ^^^^^ It is likely that "class.class" is not accurate. By inspecting the code, we might expose some possible explanations or further questions for the submitter. This appears to be a fundamental problem that affects all installed JREs. Can the submitter please rename the current deployment.properties file and retest the applet? A new default deployment.properties file will be created and used to run the applet. Perhaps there are entries in the deployment.properties file that are not handled properly by all JREs. This is the common link between all JREs and may explain why everything appears broken. If the default deployment.properties file works, please send us both copies so we can compare and contrast.
27-03-2006

EVALUATION I have run this test applet: http://java.com/applet/testvm/class.class inside swan using JRE 1.5.0_06 and Mustang. It works fine. I have run outside swan with direct access to cable modem (no proxy), using JRE 1.5.0_06 and JRE 1.6 on window XP machine, both works fine. It appear there are some configuration issue in customer's machine, and this shouldn't be a bug in Java plugin, please ask customer to test other demo applet to see whether it works or not. http://java.sun.com/products/plugin/1.5.0/demos/plugin/applets.html
24-03-2006

EVALUATION From the plugin trace, I believe the class that is not found is... http://java.com/applet/testvm/class.class This class does not exist on the server. The submitter reports that this bug is seen with all previous releases installed on the same system. Based on this, it seems that the local configuration is affecting the plugin to cause this fundamental loading problem. Can the submitter supply the stack trace for the same applet on a system that it does load properly?
24-03-2006

EVALUATION Information forwarded by the submitter: ------------------------------------- The proxy settings are: use browser settings and both IE and FF use connect to the Internet directly. Some of the Applets that no longer work were working with these same settings. For extra testing I changed the proxy settings to connect to the Internet directly (same problem), connect via different proxy servers (same problem). As a side note our ISP no longer has a proxy server and can't understand why we should need a proxy server to connect to an Applet (the service person at the ISP was able to access the Applet without a problem and without using a proxy server). I tried a few different free proxy servers without any change in result, if you would like me to try a different proxy server then please send me the URL / port number.
20-03-2006

EVALUATION The root cause appears to be a failure to connect to the applet website... Caused by: java.io.IOException: open HTTP connection failed. This is likely a test configuration problem. From trace log, the network settings for proxy is 'DIRECT' for applets. Without a proxy, the applet cannot be reached. Can the submitter please retest with the proper proxy settings in Java Control Panel?
16-03-2006

EVALUATION Since appletviewer has the same problem, transfer this bug to j2se for evaluation.
16-03-2006

EVALUATION could you try to run appletviewer <your html> to see if it's reproducible ?
04-03-2006