tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Sudden IllegalStateException
Date Mon, 05 Jan 2004 14:18:05 GMT

Howdy,
How does a RequestDispatcher forward behave here (as opposed to a
sendRedirect)?  Also, make sure you call encodeRedirectUrl before
redirecting (though this wouldn't cause an IllegalState problem, it's a
good idea).

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Merrill Cornish [mailto:merrill.cornish@earthlink.net]
>Sent: Wednesday, December 31, 2003 4:54 PM
>To: Tomcat Users List
>Subject: Sudden IllegalStateException
>
>I have been developing a JSP/servlet application using Tomcat 5.0.16.
>Over the past months, I felt that I had learned enough (partially with
>the help of this mailing list) about JSP, servlets, and Tomcat that I
>could debug most of the obsticales that popped up.  Until this morning.
>
>I  started addnig a new servlet several "levels" down. Suddenly, I
>started getting the following error:
>
>java.lang.IllegalStateException
>
org.apache.coyote.tomcat5.CoyoteResponseFacade.sendRedirect(CoyoteRes
>ponseFacade.java:379)
>	Timesheet.LoginServlet.doPost(LoginServlet.java:67)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>When I launch the application, the Tomcat HTML welcome page redirects
>via a refresh to my login.jsp page via https.  That login page displays
>properly.  When I fill in the login name and password and click on
>submit, I immediately get the above exception.  The line number it
>references is the following:
>
>      response.sendRedirect(Util.MAIN_MENU_PAGE_URL);
>
>where Util.MAIN_MENU_PAGE_URL is "/timesheet/mainMenu.jsp", a valid
page
>URL.
>
>This sendRedirect() is the last thing the login servlet does after
>validating the login and collecting information about the logged in
user
>from the database.  This has all been working for months.
>
>The one time I got an illegal state exception before was when I
>accidently did something like session.getAttribute() when the session
>was invalid.  However,  the login servlet starts with
>
>    HttpSession session = request.getSession(true);
>
>which is the ONLY time it's called with a true argument.  I have also
>verified that immediately before the call to sendRedirect(), both the
>session and response variables have reasonable values.
>
>Can any one suggest what I may have changed to suddenly get an illegal
>state exception?
>
>Merrill Cornish
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message