"Cannot create a session after the response has been committed" error from Tomcat or JBoss

Solution Unverified - Updated -


  • The following error is seen when some JSP pages are being rendered.
org.apache.jasper.runtime.JspFactoryImpl internalGetPageContext
ERROR : Exception initializing page context
java.lang.IllegalStateException: Cannot create a session after the response has been committed
        at org.apache.catalina.connector.Request.doGetSession(Request.java:2862)
        at org.apache.catalina.connector.Request.getSession(Request.java:2307)
        at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:897)


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x
  • Red Hat JBoss Enterprise Web Server (EWS)
    • 1.x
    • 2.x
    • 3.x
  • Tomcat
    • 5.x
    • 6.x
    • 7.x
    • 8.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content