1 Reply Latest reply on Jan 11, 2006 8:48 PM by Tran Lap

    SelectItem in TaskBean.java and Task.jsp

    Tran Lap Newbie

      Hi all.
      I have a problem, please help me.
      In TaskBean.java, i have a function is called: getExamDebug

      public List getExamDebug(){
       System.out.println("debug from exam");
      
       List temp1 = new ArrayList();
      
       SelectItem item=new SelectItem("item1", "item1");
       temp1.add(item);
       item=new SelectItem("item2", "item2");
       temp1.add(item);
      
       System.out.println("debug from exam");
      
       return temp1;
      }

      When this function is called, it will return only a List of SelectItem object.

      In Task.jsp i have this code:
      ....
      <h:inputHidden id="taskInstanceId" value="#{taskBean.taskInstanceId}"/>
       <h2><h:outputText value="#{taskBean.taskInstance.name}" /></h2>
       <h:selectOneListbox>
       <f:selectItems value="#{taskBean.examDebug}" />
       </h:selectOneListbox>
      ...


      Do not pay attention to my file.par.

      In the first run of Web Appp
      After i login and the task.jsp is displayed. I have a OneListBox have two item as code above.
      But when i click "Save an Close" to translate to a user called "A".
      And then i login with User "A", next i select a task from TaskList of this User the task.jsp is error.
      Error:
      08:31:12,687 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.IllegalArgumentException: Collection referenced by UISelectItems with binding '#{taskBean.listData}' and Component-Path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /task.jsp][Class: javax.faces.component.html.HtmlForm,Id: taskform][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id4][Class: javax.faces.component.html.HtmlSelectOneListbox,Id: _id5][Class: javax.faces.component.UISelectItems,Id: _id6]} does not contain Objects of type SelectItem
       at org.apache.myfaces.util.SelectItemsIterator.next(SelectItemsIterator.java:182)
       at org.apache.myfaces.renderkit.RendererUtils.internalGetSelectItemList(RendererUtils.java:487)
       at org.apache.myfaces.renderkit.RendererUtils.getSelectItemList(RendererUtils.java:461)
       at org.apache.myfaces.renderkit.html.HtmlRendererUtils.internalRenderSelect(HtmlRendererUtils.java:277)
       at org.apache.myfaces.renderkit.html.HtmlRendererUtils.renderListbox(HtmlRendererUtils.java:240)
       at org.apache.myfaces.renderkit.html.HtmlListboxRendererBase.encodeEnd(HtmlListboxRendererBase.java:73)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
       at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:450)
       at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:203)
       at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:85)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
       at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:349)
       at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:253)
       at org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55)
       at org.apache.jsp.task_jsp._jspx_meth_h_panelGrid_0(org.apache.jsp.task_jsp:466)
       at org.apache.jsp.task_jsp._jspx_meth_h_form_0(org.apache.jsp.task_jsp:336)
       at org.apache.jsp.task_jsp._jspx_meth_tiles_put_1(org.apache.jsp.task_jsp:264)
       at org.apache.jsp.task_jsp._jspx_meth_tiles_insert_0(org.apache.jsp.task_jsp:202)
       at org.apache.jsp.task_jsp._jspx_meth_f_view_0(org.apache.jsp.task_jsp:166)
       at org.apache.jsp.task_jsp._jspService(org.apache.jsp.task_jsp:131)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       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.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
       at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:233)
       at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:219)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:25)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.PersistenceFilter.doFilter(PersistenceFilter.java:28)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.ContextFilter.doFilter(ContextFilter.java:19)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:38)
       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:81)
       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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       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:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       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)
      08:31:12,859 DEBUG [PersistenceContext] rolling back transaction
      08:31:12,875 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception
      javax.faces.FacesException: Collection referenced by UISelectItems with binding '#{taskBean.listData}' and Component-Path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /task.jsp][Class: javax.faces.component.html.HtmlForm,Id: taskform][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id4][Class: javax.faces.component.html.HtmlSelectOneListbox,Id: _id5][Class: javax.faces.component.UISelectItems,Id: _id6]} does not contain Objects of type SelectItem
       at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
       at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:233)
       at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:219)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:25)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.PersistenceFilter.doFilter(PersistenceFilter.java:28)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.ContextFilter.doFilter(ContextFilter.java:19)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:38)
       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:81)
       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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       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:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       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)
      Caused by: org.apache.jasper.JasperException: Collection referenced by UISelectItems with binding '#{taskBean.listData}' and Component-Path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /task.jsp][Class: javax.faces.component.html.HtmlForm,Id: taskform][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id4][Class: javax.faces.component.html.HtmlSelectOneListbox,Id: _id5][Class: javax.faces.component.UISelectItems,Id: _id6]} does not contain Objects of type SelectItem
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       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.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
       ... 35 more


      I do not know why this error occur ?????
      Please give an answer.
      Thank very much.