On Mon, 21 May 2001, Young, Wayne wrote:

> I just submitted bug #1843. 
> 
> If you have a class "MyClass" for which a "MyClassBeanInfo" class ONLY
> EXISTS IN ANOTHER PACKAGE, then the incorrect beaninfo & hence property
> descriptors are returned.
> 
> This causes the properties in "MyClass" to be skipped during population from
> the request. This was a difficult bug to find.
> 
> The workaround is to rename the "MyClass" class to something that won't
> conflict OR create a "MyClassBeanInfo" class in the same package to describe
> the bean.
> 

This resolution of this issue was actually a little more subtle than that.

The set of "other" packages that the bean introspection code looks in is
actually configurable via a call to
Introspector.setBeanInfoSearchPath().  By default, the only package on the
search path is called "sun.beans.infos".  And (at least in JDK 1.3.1), the
only class in this package is a class called "ComponentBeanInfo" -- which
is where Wayne ran into problems -- because he wanted to call his bean
class "Component".

The solution to this is to do one of two things:
* Call Introspector.setBeanInfoSearchPath() to set some other search path
  than the standard.
* Name your bean anything othe than Component.java.

> Thanks.
> 
> Wayne
> [EMAIL PROTECTED]
> 
> 
> 

Craig


Reply via email to