Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4219203

java.lang.IllegalAccessError using Foo.class with Plugin 1.1.1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1.3
    • 1.1.1
    • deploy
    • b01
    • x86
    • windows_nt



      Name: gsC80088 Date: 03/10/99


      java.lang.IllegalAccessError: test.base.TestClassA.class$java$lang$String
      is thrown in the simple case below.

      The inclusion of the static is important.
      The applet MUST be downloaded from a webserver

      Using Class.forName(String) works OK.

      Classes:

      TestApplet
      ==========
      package test;

      import java.applet.*;
      import test.sub.TestClassB;

      public class TestApplet extends java.applet.Applet {
      public void init() {
      System.out.println("Running Test Applet");

      System.out.println("Creating ");
      new TestClassB();

      System.out.println("Done");
          }
      }

      TestClassA
      ==========
      package test.base;

      public class TestClassA extends java.lang.Object {

          public static java.lang.String DEFAULT_STRING = "";
          
          public TestClassA() {
              System.out.println("In constructor of TestClassA");
              
              System.out.println(String.class.getName());
              
              System.out.println("End constructor TestClassA");
          }
      }

      TestClassB
      ==========
      package test.sub;

      import test.base.TestClassA;
      import java.lang.*;

      public class TestClassB extends test.base.TestClassA {
          
      public TestClassB() {
      System.out.println(String.class.getName());
      }
      }

      Stack Trace
      ===========
      java.lang.IllegalAccessError: test.base.TestClassA.class$java$lang$String
      at test.sub.TestClassB.<init>(TestClassB.java:8)
      at test.TestApplet.init(TestApplet.java:12)
      at sun.applet.AppletPanel.run(AppletPanel.java:287)
      at java.lang.Thread.run(Thread.java:474)
      (Review ID: 41266)
      ======================================================================

            stanleyh Stanley Ho (Inactive)
            gstone Greg Stone
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: