This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException  RSS feed

 
spatil
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I always receive following message when session expires. I had catch the exception using try-catch block and redirecting to different Page than the current page on which exception occurs. I have set session timeout=10 minutes please help me solve this problem.

java.lang.IllegalStateException
org.apache.coyote.tomcat5.CoyoteResponseFacade.sendRedirect(CoyoteResponseFacade.java:352)
org.apache.jsp.dswmedia._37121._37121A._37121A_005funit1_jsp._jspService(_37121A_005funit1_jsp.java:484)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IllegalStateExceptions are almost always caused by using forward or sendRedirect after already having written something to the outputStream OR from not terminating page execution with a "return" statement after calling forward or sendRedirect.

Take a look at line 484 of the generated servlet code:
org.apache.jsp.dswmedia._37121._37121A._37121A_005funit1_jsp._jspService(_37121A_005funit1_jsp.java:484)

Post your JSP code if you need more help.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"spatil" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.

You can change your user name here.

Thanks! and welcome to the JavaRanch!
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you storing the session object somewhere? Since you say this happens when the session times out, I have a feeling that you're trying to use a session object that has been invalidated by the container. Just about every method of an invalidated session will throw an IllegalStateException.

-Yuriy
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!