Hi Christoper,

> -----Original Message-----
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, September 24, 2010 08:44 AM
> To: Tomcat Users List
> Subject: Re: [OT] In org.apache.catalina.connector.Request.doGetSession,
> java.lang.IllegalStateException: Cannot create a session after the response
> has been committed
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Brian,
> 
> On 9/24/2010 2:22 AM, Brian wrote:
> > Well, IT WORKED!
> 
> Excellent.
> 
> > Now the previous thing that went wrong is able to show its details in
> > the log. What is that? A Struts tag that tries to output the content
> > of a bean that is not present even though it should (this is the Struts tag:
> > <bean:write name="TEXT-NoteNoShippingFees"/>).
> 
> How is the bean declared in the page? Or, is it declared in one page and used
> in another?


The previous Struts actions places it in the session object.

 
> > That bean should always be present, because it is created in the
> > previous Struts action.
> 
> Where is it stored? Remember that there are 4 scopes (in increasing order of
> specificity): application, session, request, and page. If your page is 
> looking in
> request scope, but the bean is in the session, it won't be found. Or,
> alternatively, if you store a bean in the request and issue a redirect, then 
> the
> bean has likely been discarded.


It is stored in the session, just because I wanted to avoid the problems that 
happen when you redirect. That means that the bean will consume memory while 
the session is alive (instead of just for the time the request or response is 
alive), but memory is not a big issue here.
That makes me think that the "buffer full, then flushed" is maybe the reason 
why the bean dissappears somehow.
I have increased the buffer from 8k to 64k, and I will keep an eye on the log 
to see if it still happens.

 
> > How can it be missing SOMETIMES, if it is not the only bean that is
> > being created in the previous action, and others of these beans that
> > are created in the action are present in the page? I guess it has
> > something to do with the buffer that gets full sometimes, or am I
> > wrong? What do you think?
> 
> You'll have to give us more details. Note that this is not a Struts forum,
> though many of us (including myself) have Struts experience and would be
> glad to help. Technically, you ought to start a new thread since you're asking
> about a new subject (this helps people find answers to their questions when
> searching the archives).


You are right. If the problem still exists, I will seach for a solution in 
another source dedicated to Struts. This is no more related to Tomcat directly.

 
> > In fact, I have had LOTs of problems with beans that "dissappear" even
> > though they should be present because they were created in the
> > previous actions. I have been dealing with these "randomic" problem
> > for YEARS, and I applied just a patch for that ("If the bean is not
> > present, redirect to the home page instead of showing an error message
> > and dumping a trace in the log").  That was just a workaround, and not
> > a clean solution. I will try now to use a buffer with 16K, to see if that 
> > will
> solve this.
> 
> Could you also be experiencing session timeouts that aren't properly
> handled? Does your application use any kind of authentication and
> authorization? If not, you could easily be seeing visitors with expired 
> sessions
> accessing actions that expect the session to be in a certain state.

The sessions expire if 2 hours have passed, and if that happens, the system 
forwards them to another page. 
I mean, in my programming I already considered what should happen if the 
session suddenly expired, and it should not arrive to this point.

Thanks!
 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to