7 Replies Latest reply on Mar 21, 2007 3:22 PM by J.R. Ector

    selectManyMenu and EntityHome

    J.R. Ector Newbie

      I successfully used, the EntityHome generated by seam-gen with selectOneMenu like this:

      <h:selectOneMenu value="#{companyHome.instance.state}"
       converter="#{converters.stateConverter}">
       <s:selectItems value="#{stateList.resultList}" var="state"
       label="#{state.name}" noSelectionLabel="Please Select..."
       hideNoSelectionLabel="true" />
      </h:selectOneMenu>
      



      But when I try to use the same technique with a Collection, it throws an exception:

      
      16:48:36,828 ERROR [D2DFaceletViewHandler] Problem in renderResponse: Argument is not an array
      java.lang.IllegalArgumentException: Argument is not an array
       at java.lang.reflect.Array.getLength(Native Method)
       at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.isSelected(MenuRenderer.java:454)
       at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderOption(MenuRenderer.java:310)
       at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderOptions(MenuRenderer.java:444)
       at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderSelect(MenuRenderer.java:376)
       at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:117)
       at com.icesoft.faces.component.ext.renderkit.MenuRenderer.encodeEnd(MenuRenderer.java:51)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
       at org.jboss.seam.ui.JSF.renderChild(JSF.java:179)
       at org.jboss.seam.ui.JSF.renderChildren(JSF.java:162)
       at org.jboss.seam.ui.UIDecorate.encodeChildren(UIDecorate.java:178)
       at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341
      )
       at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:197)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:582)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
       at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:276)
       at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:402)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       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.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       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)
      


      My question is, is it not possible to use the generated entity homes like so:

      <h:selectOneMenu value="#{companyHome.instance.states}"
       converter="#{converters.stateConverter}">
       <s:selectItems value="#{stateList.resultList}" var="state"
       label="#{state.name}" noSelectionLabel="Please Select..."
       hideNoSelectionLabel="true" />
      </h:selectOneMenu>
      


      if states is a Collection?

        • 1. Re: selectManyMenu and EntityHome
          Pete Muir Master

          Surely you need a select many in this case:

          <h:selectManyListbox value="#{companyHome.instance.states}" converter="#{converters.stateConverter}">
           <s:selectItems value="#{stateList.resultList}" var="state" label="#{state.name}" noSelectionLabel="Please Select..." hideNoSelectionLabel="true" />
          </h:selectManyListbox>


          - it doesn't make any sense to use a selectOneMenu to put objects into a Collection.

          • 2. Re: selectManyMenu and EntityHome
            J.R. Ector Newbie

            You are correct, and I did use a selectManyMenu, I mistakenly posted the code, containing a selectOneMenu. Nevertheless, the problem is that the tag is having a problem with the "states" collection referenced by companyHome.instance.states, it appears to want an Array but, seam-gen produced a Set. I tried converting the Set to an Array and it still didn't work.
            Any ideas?

            • 3. Re: selectManyMenu and EntityHome
              Pete Muir Master

              No. It looks like it could be an icefaces problem to me - I've never tried a Set in that situation, but a List is fine (see the ui example)

              • 4. Re: selectManyMenu and EntityHome
                J.R. Ector Newbie

                I switched to a List and that got me past the Array error, however, it does look like it might be a problem with ICEFaces because now with the List I get this error:

                12:49:21,031 ERROR [D2DFaceletViewHandler] Problem in renderResponse: null
                java.lang.NullPointerException
                 at org.jboss.seam.ui.PrioritizableConverter.getAsString(PrioritizableConverter.java:67)
                 at org.jboss.seam.ui.ConverterChain.getAsString(ConverterChain.java:119)
                 at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.formatComponentValue(DomBasicRenderer.java:220)
                 at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderOption(MenuRenderer.java:298)
                 at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderOptions(MenuRenderer.java:444)
                 at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.renderSelect(MenuRenderer.java:376)
                 at com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:117)
                 at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
                 at org.jboss.seam.ui.JSF.renderChild(JSF.java:179)
                 at org.jboss.seam.ui.JSF.renderChildren(JSF.java:162)
                 at org.jboss.seam.ui.UIDecorate.encodeChildren(UIDecorate.java:178)
                 at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341
                )
                 at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:197)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:582)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
                 at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:276)
                 at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
                 at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
                 at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:406)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                 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.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                 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)

                I posted this error to the icefaces/seam integration forum, hopefully someone will let me know if I'm wasting my time trying to get this to work.

                Thanks for your help.

                • 5. Re: selectManyMenu and EntityHome
                  Pete Muir Master

                  Which version of Seam?

                  • 6. Re: selectManyMenu and EntityHome
                    J.R. Ector Newbie

                    Seam 1.2 Patch 1

                    • 7. Re: selectManyMenu and EntityHome
                      J.R. Ector Newbie

                      Not sure what the problem was but, I'm past it.