title: What is the cause of this error 'javax.faces.FacesException: var attribute must be set' and how to fixed this?
body: <p>I encountered this problem in my apps. The weird part was this error popups at some moment i started my apps but sometimes it does not.</p>
  
  <p>The piece of the stacktrace..</p>
  
  <pre><code>javax.faces.FacesException: var attribute must be set
      at org.jboss.seam.ui.component.UISelectItems$ContextualSelectItem.&lt;init&gt;(UISelectItems.java:58)
      at org.jboss.seam.ui.component.UISelectItems$1.&lt;init&gt;(UISelectItems.java:219)
      at org.jboss.seam.ui.component.UISelectItems.asSelectItems(UISelectItems.java:195)
      at org.jboss.seam.ui.component.UISelectItems.getValue(UISelectItems.java:178)
      at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:289)
      at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:814)
      at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:280)
  </code></pre>
  
  <p>I think the source of my error has something to do with h:selectOneMenu but i defined my var attribute correctly in my selectItems.</p>
  
  <pre><code>&lt;h:selectOneMenu value="#{myBean.user}"&gt;
     &lt;s:selectItems value="#{myBean.userList}" var="_user" label="#{_user.name}" /&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>Has anyone encountered this problem please help.
  I've done a couple of research but found no luck.</p>
  
  <p>Thanks.</p>