我正在尝试将我的应用从jsf 1.2迁移到2.1。我写了一个样本facelet页面并尝试访问它。获得以下异常。不确定导致此问题的原因。如果仅执行此页面(通过删除与我的项目相关的所有代码和库,此页面正确呈现)。任何可能导致此问题的帮助都会非常有用。
Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException: Header count exceeded allowed maximum: 128
at org.apache.tomcat.util.http.MimeHeaders.createHeader(MimeHeaders.java:329) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.http.MimeHeaders.addValue(MimeHeaders.java:347) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.Response.addHeader(Response.java:351) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.Response.addHeader(Response.java:1110) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.ResponseFacade.addHeader(ResponseFacade.java:502) [jbossweb-7.0.10.Final.jar:]
at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at com.sun.faces.context.ExternalContextImpl.<init>(ExternalContextImpl.java:137) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at com.sun.faces.context.ExternalContextFactoryImpl.getExternalContext(ExternalContextFactoryImpl.java:73) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at com.sun.faces.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:93) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:583) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [jbossweb-7.0.10.Final.jar:]
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:364) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]
答案 0 :(得分:4)
此问题与faces-config.xml有关。标题应该是。
<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
答案 1 :(得分:-1)
在头元素中包含此标记,如下所示:
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
关于wiki
的说明