You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gwen Way <gw...@cybersource.com> on 2009/08/18 20:22:16 UTC
"Exception Initializing Page Context"
Hello list.
I am working in a Win2003/CentOS 5.3 environment and have run into a
Java error today that has me baffled. It is the first time that anyone
here has seen this particular error. It appears to be insinuating that
a connection is being lost and then something is trying to close it
again - at least according to what I've been able to dig up thus far on
Google and in various forums - but I am unsure of why this connection is
closing unexpectedly or what is trying to close it the second time. For
the sake of clarity, it is important to note that the Java applications
are running on CentOS, not Windows. The server logs don't shed any
light on this issue so I thought that I would check in and see if this
was familiar to any of you. The text of the error appears as follows:
TIME THREAD
LEVEL CATEGORY
MESSAGE
5731071296 ajp-0.0.0.0-8009-3 FATAL
org.apache.jasper.runtime.JspFactoryImpl 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:2301)
at
org.apache.catalina.connector.Request.getSession(Request.java:2075)
at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.jav
a:833)
at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.jav
a:844)
at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.ja
va:144)
at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.jav
a:122)
at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFacto
ryImpl.java:106)
at
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.j
ava:62)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:65)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:373)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
sociationValve.java:179)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.j
ava:84)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConn
ectionValve.java:157)
at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:
393)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
62)
at
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
at
org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtoc
ol.java:366)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
If any of you lovely people can help me find some insight on this error,
I would appreciate it greatly.
Gwen Way
Support Analyst
CyberSource Corporation
gway@cybersource.com
Phone - 512-680-9243
Fax - 650-210-2456
Re: "Exception Initializing Page Context"
Posted by Ognjen Blagojevic <og...@etf.bg.ac.rs>.
Gwen Way wrote:
> Hmmm... I will check with the developers then, although the three
> people on my team are theoretically the only ones with access to make
> changes to the app. Thank you again, Mark.
If you worry how come that application previously worked but now it
doesn't, I can think of at least two reasons:
1. HttpServletResponse buffer size is determined by the server at
runtime, and for different reasons now your server decides to use
smaller buffer than earlier, so it gets filled and committed before you
set a cookie.
2. You fill the buffer with dynamic data (say, from database) and that
data is now bigger than earlier and the buffer gets filled and committed
before you set a cookie.
IOW, the only good way is to set a cookie is before writing anything to
the response, unless you have precise control on the HttpServletReponse
buffer which is rarely the case.
Regards,
Ognjen
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: "Exception Initializing Page Context"
Posted by Gwen Way <gw...@cybersource.com>.
Mark Thomas wrote:
>The only thing I can think of that would change that is a change to
your
>application code.
Hmmm... I will check with the developers then, although the three
people on my team are theoretically the only ones with access to make
changes to the app. Thank you again, Mark.
Gwen Way
Support Analyst
CyberSource Corporation
gway@cybersource.com
Phone - 512-680-9243
Fax - 650-210-2456
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: "Exception Initializing Page Context"
Posted by Mark Thomas <ma...@apache.org>.
Gwen Way wrote:
> Thank you, Mark. I appreciate you taking the time to get back to me on
> this.
>
> I've been doing a little more research and it seems that there were no
> updates this week for Tomcat and nothing has changed in terms of this
> CentOS server or are application. It does not seem that a change in
> network architecture would create such an error, although I could be
> wrong. As this particular error has made its appearance in the last two
> days, there must have been some kind of change. Could you recommend a
> place I should start investigating to see what would cause a session to
> alter how and when it opens?
The only thing I can think of that would change that is a change to your
application code.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: "Exception Initializing Page Context"
Posted by Gwen Way <gw...@cybersource.com>.
Thank you, Mark. I appreciate you taking the time to get back to me on
this.
I've been doing a little more research and it seems that there were no
updates this week for Tomcat and nothing has changed in terms of this
CentOS server or are application. It does not seem that a change in
network architecture would create such an error, although I could be
wrong. As this particular error has made its appearance in the last two
days, there must have been some kind of change. Could you recommend a
place I should start investigating to see what would cause a session to
alter how and when it opens?
Again, thank you.
Gwen Way
Support Analyst
CyberSource Corporation
gway@cybersource.com
Phone - 512-680-9243
Fax - 650-210-2456
-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org]
Sent: Tuesday, August 18, 2009 4:40 PM
To: Tomcat Users List
Subject: Re: "Exception Initializing Page Context"
Gwen Way wrote:
> java.lang.IllegalStateException: Cannot create a session after the
> response has been committed
Seems pretty clear.
Creating a session requires setting some headers (to send the session
cookie to the client). You can't do that after the response has been
committed (usually after a few kilobytes of data has been written).
The solution? Create your session earlier, ideally before yousend any
content to the client.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: "Exception Initializing Page Context"
Posted by Mark Thomas <ma...@apache.org>.
Gwen Way wrote:
> java.lang.IllegalStateException: Cannot create a session after the
> response has been committed
Seems pretty clear.
Creating a session requires setting some headers (to send the session
cookie to the client). You can't do that after the response has been
committed (usually after a few kilobytes of data has been written).
The solution? Create your session earlier, ideally before yousend any
content to the client.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org