Introspection APIs change for getter and setter methods in EJBs
 Technote (troubleshooting)
 
Problem(Abstract)
After upgrading your JDK to IBM® SDK 1.3.1 SR7 or Sun® JDK 1.3.1_09, if an EJB has more than one getter or setter method for any given property, you receive the error, "No getter method for property <property_name> of bean <bean_name>".
 
Cause
This occurs because the JDK specification changed after the release of Sun JDK 1.3.1_09 and IBM SDK 1.3.1 SR7.
 
Resolving the problem
As per the introspection specification API, property can have method that returns property type called getter method and can have method to set value for this property by taking parameter of property type called setter method.
If there is a matching pair of get<PropertyName> and set<PropertyName> methods that takes and return the same type, these methods defined a read-write property called <PropertyName>. For example, a bean that has a read-write property called text of type String, has the methods

public String getText();
public void setText(String str);

Until JDK 1.3.1 SR6, overloading of setter methods was possible. For example, if a bean had a String property text, then overloading setter methods was possible as the following shows:

private String text;
public String getText();
public void setText(Integer iText);
public void setText(String str);

In IBM SDK 1.3.1 SR7 and later, the method setText(Integer iText) in the preceding example is not considered a setter method because it takes integer object as the input parameter, while the property text is of type String.

In other words, the setter method that takes an argument that is of the same type as the property is the one that is returned.
 
Related information
JavaBeans 1.1 specification
Sun bug report for this problem
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Java SDK
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1192605
IBM Group: Software Group
Modified date: Sep 9, 2004