0 Replies Latest reply on Dec 25, 2004 3:42 PM by Abdennour Laaroubi

    JSF deployment

    Abdennour Laaroubi Newbie

      I am using jboss4 RC. I have a JSF page. Every time I deploy it (war file), I get the following error:
      javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.model.SelectItem

      If I restart the server, the problem goes away. As soon as the JSF page is modified and deployed, I get the same exception.
      I have to restart the server everytime I modify the page.....if i can't solve this problem, I have to use another application server or drop JSF and use struts.....

      My guess is the server caches the JSF tree (UI component.). This cache is not invalidated when you deploy a new version of the jsf page(which may have different UI component). The server tries to use the old cache in the retrieve phase (extracts the elements from the request and populates the UI elements). They don't match....then the exception is thrown...
      The problem can be solved by restarting the server......That's my guess but may be I am wrong.....

      Any idea what may be causing this??

      Here is the stack:

      javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.model.SelectItem
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
      org.apache.jsp.login_jsp._jspService(login_jsp.java:82)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
      com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
      com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
      com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

      root cause

      java.lang.ClassCastException: javax.faces.model.SelectItem
      com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:492)
      com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:465)
      com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:430)
      javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:720)
      javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:623)
      javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:546)
      com.sun.faces.taglib.html_basic.SelectOneMenuTag.doEndTag(SelectOneMenuTag.java:505)
      org.apache.jsp.login_jsp._jspx_meth_h_selectOneMenu_0(login_jsp.java:381)
      org.apache.jsp.login_jsp._jspx_meth_h_form_0(login_jsp.java:192)
      org.apache.jsp.login_jsp._jspx_meth_f_view_0(login_jsp.java:115)
      org.apache.jsp.login_jsp._jspService(login_jsp.java:75)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
      com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
      com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
      com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

      note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.