我正在尝试在 JSF 上创建一个简单的程序。我将它部署在 JBOSS 5 服务器上。但是当我尝试运行它时,它会抛出这些异常。
类型异常报告
消息 描述 服务器遇到一个内部错误 () 阻止它完成此请求。
异常org.apache.jasper.JasperException: java.lang.RuntimeException: 找不到 FacesContext org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper. java:411) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) javax.servlet.http.HttpServlet.service( HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
根本原因
java.lang.RuntimeException: 找不到 FacesContext javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855) javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672) org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0 (index_jsp.java:90) org.apache.jsp.index_jsp._jspService(index_jsp.java:67) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service (HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) org.apache.jasper.servlet .JspServlet.service(JspServlet.java:249) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters。ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)