Mar 1, 2011

javax.servlet.ServletException: BeanUtils.populate

troubleshooting

error log in browser
javax.servlet.ServletException: BeanUtils.populate

possible solution

in dao class, if the data member is of self-defined class, test for null in its get method and assign a new object to it.
for example
class Dao extends VersionDAO {
    private String str;
    private DateInput sampleDate = new DateInput();
    public String getStr() {
        return str;
    }
    public void setStr(String str) {
        this.str = str;
    }
    public DateInput getSampleDate() {
        if (sampleDate == null)
            sampleDate = new DateInput();
        return sampleDate;
    }
    public void setSampleDate(DateInput sampleDate) {
        this.sampleDate = sampleDate;
    }
}

comments
may have other causes if this is not the case

No comments:

Post a Comment