JSF Conversion Error setting value

java.lang.IllegalArgumentException: Conversion Error setting value ''{0}'' for ''{1}''.


java.lang.IllegalArgumentException: Conversion Error setting value ''{0}'' for ''{1}''.
	com.sun.faces.util.Util.getSelectItems(Util.java:638)
	com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:509)
	com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:486)
	com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:451)
	javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740)
	javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:645)
	javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:568)
	com.sun.faces.taglib.html_basic.SelectOneMenuTag.doEndTag(SelectOneMenuTag.java:505)
    

Not the most helpful message. I used the wrong tag. I wanted to return and display a list of options using selectItems, not selectItem.

It should have been:


 <f:selectItems value="#{stockBean.exchanges}"/>

instead of:


 <f:selectItem value="#{stockBean.exchanges}"/>

Published: Saturday, 13 November 2010