[jboss-user] [JBoss Seam] - Peter Muir - @SelectItems

mrohad do-not-reply at jboss.com
Wed Aug 16 10:26:34 EDT 2006


hi , thanks , I'm using yours now
getting the same exception:

  | 18:22:24,087 INFO  [STDOUT] Hibernate: select codes0_.ID as ID121_, codes0_.TABLE as TABLE121_, codes0_.DESCRIPTION as DESCRIPT3_121_, codes0_.CODE as CODE121_, codes0_.LABEL as LABEL121_, codes0_.disabled as disabled121_ from wannabet.codes codes0_ where codes0_.TABLE=?
  | 18:22:24,097 INFO  [STDOUT] Hibernate: select codes0_.ID as ID121_, codes0_.TABLE as TABLE121_, codes0_.DESCRIPTION as DESCRIPT3_121_, codes0_.CODE as CODE121_, codes0_.LABEL as LABEL121_, codes0_.disabled as disabled121_ from wannabet.codes codes0_ where codes0_.TABLE=?
  | 18:22:24,107 ERROR [STDERR] 16/08/2006 18:22:24 com.sun.facelets.FaceletViewHandler handleRenderException
  | SEVERE: Error Rendering View[/login/register.xhtml]
  | java.lang.IllegalArgumentException: Value binding '#{cLang}'of UISelectItems with component-path {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /login/register.xhtml][Class: javax.faces.component.html.HtmlForm,Id: _id38][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id40][Class: javax.faces.component.html.HtmlSelectOneMenu,Id: _id51][Class: javax.faces.component.UISelectItems,Id: _id52]} does not reference an Object of type SelectItem, SelectItem[], Collection or Map but of type : null
  | 	at org.apache.myfaces.shared_impl.util.SelectItemsIterator.hasNext(SelectItemsIterator.java:141)
  | 	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.internalGetSelectItemList(RendererUtils.java:477)
  | 	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getSelectItemList(RendererUtils.java:453)
  | 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.internalRenderSelect(HtmlRendererUtils.java:277)
  | 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.renderMenu(HtmlRendererUtils.java:251)
  | 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlMenuRendererBase.encodeEnd(HtmlMenuRendererBase.java:54)
  | 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
  | 	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
  | 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
  | 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
  | 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
  | 	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
  | 	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
  | 	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
  | 	at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
  | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  | 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 18:22:24,167 INFO  [STDOUT] Hibernate: select codes0_.ID as ID121_, codes0_.TABLE as TABLE121_, codes0_.DESCRIPTION as DESCRIPT3_121_, codes0_.CODE as CODE121_, codes0_.LABEL as LABEL121_, codes0_.disabled as disabled121_ from wannabet.codes codes0_ where codes0_.TABLE=?

I changed my code to be like that:

  |     @SelectItems(label="label")
  |     private List<Codes> cLang;
  |     
  |     @Factory("cLang")
  |     public void getLanguages() 
  |     {
  |     	List resultList = em.createQuery("select c from Codes c where c.table = :table")
  |     	.setParameter("table","languages")
  |     	.getResultList();
  |     	this.cLang = resultList;
  |   
  |     }
and my jsfto :

  | 					<h:selectOneMenu  converter="org.jboss.seam.EntityConverter"> 
  | 						<f:selectItems value="#{cLang}" />
  | 					</h:selectOneMenu>
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965487#3965487

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965487



More information about the jboss-user mailing list