JDK-4065738 : Beans.instantiate gives wrong error
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.1.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5
  • CPU: sparc
  • Submitted: 1997-07-18
  • Updated: 1997-07-29
  • Resolved: 1997-07-29
Related Reports
Duplicate :  
Relates :  
Description
 
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

Comments
EVALUATION This got fixed as part of fixing #4067824. KGH 7/29/97
11-06-2004

WORK AROUND
11-06-2004

SUGGESTED FIX
11-06-2004