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

Beans.instantiate gives wrong error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.2
    • client-libs
    • None
    • sparc
    • solaris_2.5

       
      I had a bean with an object VJBca63a13729.VJTlc (i.e VJBca63a13729/VJTlc.ser)

      calling Beans.instantiate on that gave an incorrect error msg:

      java.lang.ClassNotFoundException: VJBca63a13729.VJTlc
              at sun.beanbox.SimpleClassLoader.loadClass(SimpleClassLoader.java:218)
      ...

      After investigating a bit I found out that deserialization had failed because
      of:

      java.io.InvalidClassException: connect.widgets.ImageListBox; Local class not compatible
              at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java)
              at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java)
      ...
      ...

      However Beans.instantiate ingnored this exception and moved on to loading
      the class.


      ==============================================

      Another case is for handling BAD beans (one with no no-arg constructor)
      Beans.instantiate throws an Error which may be desirable.

      java.lang.NoSuchMethodError
      at java.beans.Beans.instantiate(Beans.java:128)

      pramod.jajoo@Eng 1997-08-15

            ghamiltosunw Graham Hamilton (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: