title: Faces Servlet threw exception: java.lang.IllegalStateException
body: <p>I am trying to migrate my app from jsf 1.2 to 2.1. I wrote a sample facelet page and tried to access it. Getting following exception. Not sure what causes this issue. If execute only this page (by removing all code and libraries related to my project, this page rendering properly). Any help on what could cause this issue would be really helpful.</p>
  
  <pre><code>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.&lt;init&gt;(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]
  </code></pre>