GeeCON Prague 2014*
The moose likes Servlets and the fly likes session probelm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "session probelm" Watch "session probelm" New topic
Author

session probelm

Jacelyn Yong
Greenhorn

Joined: Feb 16, 2005
Posts: 3
hi all,

java.lang.IllegalStateException: Cannot create a session after the response has been committed

i got this error when i try to logon to my web through my logon servlet... why this would happen & what cause this? any solution?


thanks.....
jacelyn (",)>
Sravan Kumar
Ranch Hand

Joined: Sep 11, 2005
Posts: 121
You are trying to create a session after the response had been committed. Have you placed a call to flush() or close() method on the response writer before you create the session?

Once you call these, the response is sent to the client and the request is essentially considered to have been served. Also, check out if you have forwarded the request before you create the session in the servlet. One of these must be the reason.


keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

"jacelyn ysw",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
Would you mind to post your code up, so that we can diagnose it better?


SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
 
GeeCON Prague 2014
 
subject: session probelm