I have an issue where it seems every other deploy of my app to production results in the following exception:
The enum looks like this:Code:ERROR [org.springframework.web.servlet.tags.form.SelectTag] Invalid property 'label' of bean class [com.voxeo.evolution.domain.EmployeeType]: Bean property 'label' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? org.springframework.beans.NotReadablePropertyException: Invalid property 'label' of bean class [com.voxeo.evolution.domain.EmployeeType]: Bean property 'label' 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:729) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721) at org.springframework.web.servlet.tags.form.OptionWriter.doRenderFromCollection(OptionWriter.java:216) at org.springframework.web.servlet.tags.form.OptionWriter.renderFromArray(OptionWriter.java:158) at org.springframework.web.servlet.tags.form.OptionWriter.writeOptions(OptionWriter.java:136) at org.springframework.web.servlet.tags.form.SelectTag.writeTagContent(SelectTag.java:222) at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79) at org.apache.jsp.WEB_002dINF.views.employeedir.employeeForm_jsp._jspx_meth_form_005fselect_005f0(employeeForm_jsp.java:1089)
Here's the relevant JSP snippet:Code:public enum EmployeeType { ALL("All", "All"), PERS("Person", "People"), ZCON("Conference Room", "Conference Rooms"), ZFAX("Fax", "Fax Numbers"), ZOFF("Office", "Offices"), ZOTH("Other", "Other"); private String label; private String pluralLabel; EmployeeType(String label, String pluralLabel) { this.label = label; this.pluralLabel = pluralLabel; } public String getLabel() { return label; } public String getPluralLabel() { return pluralLabel; } }
Here's the controller code where I add the enum values to the model:Code:<form:select path="type" items="${types}" itemLabel="label"/>
I'm never able to reproduce the exception locally. I've scoured the forums and google but it doesn't seem to be a common issue.Code:model.addAttribute("types", EmployeeType.values());
Anyone see this before?


Reply With Quote
