DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7135>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7135

Misleading error message when beaninfo class conflict occurs

           Summary: Misleading error message when beaninfo class conflict
                    occurs
           Product: Commons
           Version: 1.0 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Bean Utilities
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Because BeanUtils uses introspection to access properties, it is subject to the 
quirks of java.beans.Introspector. In particular, this may result, at times, in 
error messages such as "object not an instance of declaring type" or "property 
not found" (the exception is a java.lang.IllegalArgument). The cause of this is 
a conflict in BeanInfo classes.

As an example, create a class called Component, but do not create the bean info 
class. When you try to use introspection on this class, java.beans.Introspector 
loads the bean info for java.awt.Component. For the write up on why this 
occurs, see the javadoc for java.beans.Introspector.

The workaround for this is to create a BeanInfo class. The problem is that it 
is hard to determine this from the error message.

My suggestion is that, when an IllegalArgumentException occurs, the exception 
handler should verify that the bean is an instance of the declaring type. It 
could then display a more meaningful error message, including the class of both 
the bean and the method's declaring class, and a suggestion that the BeanInfo 
clash could be causing the problem.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to