We are facing an issue in IBM RAD IDE environment (IBM JDK 1.6 as the runtime JRE) while executing a test case. The same code is running fine with Springsource IDE (Sun JDK 1.6 as the runtime JRE). Is it an issue with JDK or with Spring framework. Brief code history : There is a java bean as below
class User {
final Map<Integer,String> securityQuestions = Collections.synchronizedMap(new HashMap<Integer,String>(MAX_SECURITY_QUESTIONS));
final Map<Integer,String> securityAnswers = Collections.synchronizedMap(new HashMap<Integer,String>(MAX_SECURITY_QUESTIONS));
public Map<Integer,String> getSecurityAnswers() {
return securityAnswers;
}
public void setSecurityAnswer(Integer answerNumber, String answerText) {
securityAnswers.put(answerNumber, answerText);
}
}
when we are trying to validate the 'securityAnswers' using
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "securityAnswers", "seqQans.obj.required","security Question list cannot be empty");
we are getting this exception.
Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'securityAnswers' of bean class [User]: Bean property 'securityAnswers' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:705) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:697) at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99) at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:226) at org.springframework.validation.ValidationUtils.rejectIfEmptyOrWhitespace(ValidationUtils.java:224) at org.springframework.validation.ValidationUtils.rejectIfEmptyOrWhitespace(ValidationUtils.java:182)
Sorry ! but I don't believe RAD has anything to do with this.The exception clearly states the reason why this is happening:
Answer is no :)