title: Primefaces Push - TimeoutException
body: <p>I'm using the primefaces push framework in my application. It usually works fine and the sockets are sending the data without a problem. However sometimes it looks like my request is not being processed and after about 30 seconds the following exception is written to my log file.</p>
  
  <pre><code>2016-02-15T15:50:26.323+0100|Warnung: StandardWrapperValve[Push Servlet]: Servlet.service() for servlet Push Servlet threw exception
  java.io.IOException: java.util.concurrent.TimeoutException
      at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleRead(TCPNIOTransportFilter.java:90)
      at org.glassfish.grizzly.filterchain.TransportFilter.handleRead(TransportFilter.java:173)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.read(DefaultFilterChain.java:375)
      at org.glassfish.grizzly.filterchain.FilterChainContext.read(FilterChainContext.java:700)
      at org.glassfish.grizzly.http.io.InputBuffer.fill(InputBuffer.java:970)
      at org.glassfish.grizzly.http.io.InputBuffer.read(InputBuffer.java:328)
      at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:267)
      at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:270)
      at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
      at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
      at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
      at java.io.InputStreamReader.read(InputStreamReader.java:184)
      at java.io.BufferedReader.read1(BufferedReader.java:203)
      at java.io.BufferedReader.read(BufferedReader.java:279)
      at java.io.Reader.read(Reader.java:140)
      at org.atmosphere.util.IOUtils.readEntirelyAsString(IOUtils.java:155)
      at org.atmosphere.util.IOUtils.readEntirely(IOUtils.java:106)
      at org.primefaces.push.impl.PushEndpointHandlerProxy.onRequest(PushEndpointHandlerProxy.java:151)
      at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:223)
      at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:115)
      at org.atmosphere.container.GlassFishServ30WebSocketSupport.service(GlassFishServ30WebSocketSupport.java:71)
      at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2285)
      at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:191)
      at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:177)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.util.concurrent.TimeoutException
      at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader.read(TemporarySelectorReader.java:127)
      at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader.read(TemporarySelectorReader.java:76)
      at org.glassfish.grizzly.AbstractReader.read(AbstractReader.java:72)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleRead(TCPNIOTransportFilter.java:77)
      ... 63 more
  </code></pre>
  
  <p>After said exception the application is not working correctly anymore and the sockets receive constant java script errors. The following exception is then constantly being written to the log.</p>
  
  <pre><code>2016-02-15T15:50:26.342+0100|Warnung: org.apache.catalina.core.StandardHostValve@52e4cd39: Exception Processing ErrorPage[exceptionType=java.lang.Throwable, location=/errors/500.xhtml]
  javax.servlet.ServletException: getOutputStream() has already been called for this response
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:695)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:626)
      at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:492)
      at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:691)
      at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:306)
      at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:232)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:359)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalStateException: getOutputStream() has already been called for this response
      at org.apache.catalina.connector.Response.getWriter(Response.java:777)
      at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:224)
      at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:152)
      at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:834)
      at javax.faces.context.ExternalContextWrapper.getResponseOutputWriter(ExternalContextWrapper.java:785)
      at javax.faces.context.ExternalContextWrapper.getResponseOutputWriter(ExternalContextWrapper.java:785)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.createResponseWriter(FaceletViewHandlingStrategy.java:1169)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
      at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
      ... 29 more
  ----- Root Cause -----
  java.lang.IllegalStateException: getOutputStream() has already been called for this response
      at org.apache.catalina.connector.Response.getWriter(Response.java:777)
      at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:224)
      at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:152)
      at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:834)
      at javax.faces.context.ExternalContextWrapper.getResponseOutputWriter(ExternalContextWrapper.java:785)
      at javax.faces.context.ExternalContextWrapper.getResponseOutputWriter(ExternalContextWrapper.java:785)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.createResponseWriter(FaceletViewHandlingStrategy.java:1169)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
      at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:695)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:626)
      at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:492)
      at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:691)
      at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:306)
      at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:232)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:359)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>My web.xml looks as follows.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0"&gt;
      &lt;display-name&gt;iPCC&lt;/display-name&gt;
      &lt;module-name&gt;iPCC&lt;/module-name&gt;
  
      &lt;!-- WEB SERVICE --&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;com.sun.xml.ws.transport.http.servlet.WSServletContextListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;WSServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;WSServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/services/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
  
      &lt;security-constraint&gt;
          &lt;web-resource-collection&gt;
              &lt;web-resource-name&gt;ipcc&lt;/web-resource-name&gt;
              &lt;url-pattern&gt;/home&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/call&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/device/*&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/facility/*&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/axiome/*&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/monitor&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/event&lt;/url-pattern&gt;
              &lt;url-pattern&gt;/callQueuing&lt;/url-pattern&gt;
          &lt;/web-resource-collection&gt;
          &lt;auth-constraint&gt;
              &lt;role-name&gt;SystemUserRole&lt;/role-name&gt;
          &lt;/auth-constraint&gt;
          &lt;user-data-constraint&gt;
              &lt;transport-guarantee&gt;NONE&lt;/transport-guarantee&gt;
          &lt;/user-data-constraint&gt;
      &lt;/security-constraint&gt;
  
      &lt;login-config&gt;
          &lt;auth-method&gt;FORM&lt;/auth-method&gt;
          &lt;realm-name&gt;ipcc&lt;/realm-name&gt;
          &lt;form-login-config&gt;
              &lt;form-login-page&gt;/login&lt;/form-login-page&gt;
              &lt;form-error-page&gt;/loginerror&lt;/form-error-page&gt;
          &lt;/form-login-config&gt;
      &lt;/login-config&gt;
  
      &lt;!-- JSF mapping --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  
      &lt;!-- PUSH --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Push Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.primefaces.push.PushServlet&lt;/servlet-class&gt;
          &lt;async-supported&gt;true&lt;/async-supported&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Push Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/primepush/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;!-- MIME mapping --&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;gif&lt;/extension&gt;
          &lt;mime-type&gt;image/gif&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;png&lt;/extension&gt;
          &lt;mime-type&gt;image/png&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;error-page&gt;
          &lt;exception-type&gt;javax.faces.application.ViewExpiredException&lt;/exception-type&gt;
          &lt;location&gt;/errors/timeOutPage.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;exception-type&gt;com.ilogs.ipcc.common.exception.AxiomeDeviceNotFoundException&lt;/exception-type&gt;
          &lt;location&gt;/errors/axiomeDeviceNotFound.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;exception-type&gt;com.sun.faces.context.FacesFileNotFoundException&lt;/exception-type&gt;
          &lt;location&gt;/errors/404.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;exception-type&gt;java.lang.Throwable&lt;/exception-type&gt;
          &lt;location&gt;/errors/500.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;error-code&gt;500&lt;/error-code&gt;
          &lt;location&gt;/errors/500.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;error-code&gt;404&lt;/error-code&gt;
          &lt;location&gt;/errors/404.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;error-code&gt;401&lt;/error-code&gt;
          &lt;location&gt;/errors/401.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;error-code&gt;403&lt;/error-code&gt;
          &lt;location&gt;/errors/403.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;context-param&gt;
          &lt;description&gt;iPCC svn revision&lt;/description&gt;
          &lt;param-name&gt;svn.revision&lt;/param-name&gt;
          &lt;param-value&gt;@@svn.revision@@&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;description&gt;iPCC version&lt;/description&gt;
          &lt;param-name&gt;version&lt;/param-name&gt;
          &lt;param-value&gt;@@version@@&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;com.ocpsoft.pretty.BASE_PACKAGES&lt;/param-name&gt;
          &lt;param-value&gt;com.ilogs&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;com.ocpsoft.pretty.SCAN_LIB_DIRECTORY&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;primefaces.THEME&lt;/param-name&gt;
          &lt;param-value&gt;none&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;primefaces.mobile.THEME&lt;/param-name&gt;
          &lt;param-value&gt;none&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;primefaces.FONT_AWESOME&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;primefaces.UPLOADER&lt;/param-name&gt;
          &lt;param-value&gt;commons&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.FACELETS_SKIP_COMMENTS&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.FACELETS_LIBRARIES&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/ipcc.taglib.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.FACELETS_BUFFER_SIZE&lt;/param-name&gt;
          &lt;param-value&gt;1048576&lt;/param-value&gt; &lt;!-- 1MB --&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;com.sun.faces.writeStateAtFormEnd&lt;/param-name&gt;
          &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;org.atmosphere.useStream&lt;/param-name&gt;
          &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Session configuration --&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;15&lt;/session-timeout&gt;
  
          &lt;cookie-config&gt;
              &lt;http-only&gt;true&lt;/http-only&gt;
          &lt;/cookie-config&gt;
      &lt;/session-config&gt;
  
      &lt;!-- web fonts --&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;eot&lt;/extension&gt;
          &lt;mime-type&gt;application/vnd.ms-fontobject&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;otf&lt;/extension&gt;
          &lt;mime-type&gt;font/opentype&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;ttf&lt;/extension&gt;
          &lt;mime-type&gt;application/x-font-ttf&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;woff&lt;/extension&gt;
          &lt;mime-type&gt;application/x-font-woff&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;woff2&lt;/extension&gt;
          &lt;mime-type&gt;application/x-font-woff2&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;svg&lt;/extension&gt;
          &lt;mime-type&gt;image/svg+xml&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
  
      &lt;!-- Filters --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;LocaleFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.iLogs.jee.utils.LocaleFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
          &lt;filter-class&gt;org.primefaces.webapp.filter.FileUploadFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;LocaleFilter&lt;/filter-name&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
          &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
          &lt;dispatcher&gt;ERROR&lt;/dispatcher&gt;
      &lt;/filter-mapping&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <hr>
  
  <p>Primefaces 5.3.4,
  Atmosphere 2.4.2,
  GlassFish Server Open Source Edition 4.0 (build 89).</p>