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

ava.lang.InternalError: Unable to access writeObject method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.4.0
    • core-libs
    • None

      Serialization of some classes (FILE, URL etc) throws exception.

      -------- Test.java ---------
      import java.io.*;

      class Test implements java.io.Serializable {
          public static void main (String argv[]) {

            try {
      FileOutputStream ostream = new FileOutputStream("t.tmp");
      ObjectOutputStream p = new ObjectOutputStream(ostream);
       
      p.writeInt(12345);
      p.writeObject("Today");
      p.writeObject(new File("Test.java"));
       
      p.flush();
      ostream.close();
            }
            catch (Exception e) {
      e.printStackTrace();
            }

          }
      }
      ------------------------------

      % java -version
      java version "1.4.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b42)
      Java HotSpot(TM) Client VM (build 1.4beta-B42, mixed mode)

      % java Test
      Exception in thread "main" java.lang.InternalError: Unable to access writeObject method
              at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1895)
              at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)
              at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
              at Test.main(Test.java:12)

      --------------
      Fails in build B-42. Works fine with build-B41

            mwarressunw Michael Warres (Inactive)
            hvilekar Harshad Vilekar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: