I have a strange problem with the method PropertyUtils.getProperty(bean, fieldName)where I got it java.lang.NoShuchMethodException.
Suppose we have a simple java class called pojo:
public class Pojo {
public java.util.Date aDate;
public java.util.Date theDate;
public Pojo(){}
}
and caller class for example
public class TestPojo{
public static void main(String[] args){
Pojo p = new Pojo();
p.setADate(new Date());
p.setTheDate(new Date());
PropertyUtils.getProperty(p, "theDate");
PropertyUtils.getProperty(p, "aDate");
}
}
The first call PropertyUtils.getPropertyworks fine, and the second - throw NoSuchMethodExeption.
I would like to know if I am missing something stupid or is it really a mistake :)
source
share