1 Reply Latest reply on Dec 14, 2007 9:58 AM by burakbayramli

    Expected a child component type of  UISelectItem/UISelectIte

    burakbayramli Newbie

      Hi all,

      h:selectOneMenu is causing problems on Seam 2.0 for some unknown reason. It used to work fine on 1.2. Here is the code.

      Thanks in advance,

      <h:selectOneMenu value="#{carService.garage}">
       <f:selectItems value="#{carService.garages}"/>
      </h:selectOneMenu>
      


      @Stateful
      @Name("carService")
      public class CarServiceBean implements CarService, Serializable
      {
      ....
      List<Garage> garages;
      
       public Map<String,Integer> getGarages() {
       Map<String,Integer> map = new TreeMap<String,Integer>();
      
       garages = em.createQuery("from Garage g").getResultList();
      
       for (Garage g : garages)
       {
       map.put(g.getDescription(), g.getGarageId());
       }
       return map;
       }
      }
      


      15:00:29,437 ERROR [STDERR] Dec 13, 2007 3:00:29 PM com.sun.facelets.FaceletView
      Handler handleRenderException
      SEVERE: Error Rendering View[/home.xhtml]
      java.lang.IllegalArgumentException: Expected a child component type of UISelectI
      tem/UISelectItems for component type javax.faces.SelectOne(j_id27). Found null.
      
       at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.
      java:357)
       at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuR
      enderer.java:675)
       at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRend
      erer.java:793)
       at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRendere
      r.java:335)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:
      836)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.
      java:812)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.jav
      a:592)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePha
      se.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:83)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
      onnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ss(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
      6)