6 Replies Latest reply on Aug 16, 2006 12:09 PM by pmuir

    Peter Muir - @SelectItems

    mrohad

      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>
      


        • 1. Re: Peter Muir - @SelectItems
          mrohad

          Peter , in your example you use SFSB is it a must?
          I'm using SLSB

          • 2. Re: Peter Muir - @SelectItems
            pmuir

            No SLSB or SFSB is fine.

            Normally you would have a value attribute on the selectOneMenu - can you try putting one on? I don't think it is the problem but I would like to eliminate that!

            Could you add a log.debug statement to the factory method

            log.debug("cLang has " + this.cLang.size() + " entries");


            as the last line and post the resultant log output?

            • 3. Re: Peter Muir - @SelectItems
              mrohad

              2006-08-16 19:50:52,931 DEBUG [com.wannabet.login.LoginAction] cLang has 2 entries

              any other ide?

              btw , thank you very much helping here , i am trying to use this selectItem for long time now

              • 4. Re: Peter Muir - @SelectItems
                pmuir

                I'm running out of ideas. Can you zip up your source so I can take a look at the whole thing? It would have to just include the files relevant to the selectitems stuff.

                • 5. Re: Peter Muir - @SelectItems
                  mrohad

                  just before sending you my source files
                  here is 2 rows from server.log that comes before the row I showed you before:

                  2006-08-16 19:50:52,951 DEBUG [org.jboss.seam.Component] seam component not found: cLang
                  2006-08-16 19:50:52,951 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
                  

                  any idea? or should I send you my sources?and where

                  • 6. Re: Peter Muir - @SelectItems
                    pmuir

                    peter at splendid dot co dot uk if it isn't too big or upload it somewhere and send me a link