tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Null-pointer exception from response.encodeUrl under Windows Tomcat 7
Date Wed, 15 Jun 2011 17:54:55 GMT
2011/6/15 Jocelyn Ireson-Paine <popx@j-paine.org>:
>     ResponseHolder rh = (ResponseHolder)this_session.getAttribute(
>  "response_holder" );
>     out.println( "rh = " + rh + ".<BR>" );
>     if ( rh == null ) {
>       out.println( "rh is null.<BR>" );
>       rh = new ResponseHolder( response );
>       this_session.setAttribute( "response_holder", rh );
>(...)
> If this a bug, is there any chance of getting it fixed, or of getting a
> circumvention? If I'm doing something bad, please tell me.
>

It is not a bug. It is just you doing something bad.

The request and response objects must never be accessed outside the
request processing cycle.  The objects are recycled and cleared or
reused for subsequent request and responses, and are not guaranteed to
be thread-safe.  The consequences can be severe.


There is a configuration option (a system property) that forces
recycling (zeroing) those objects, to spot misappropriate references
more easily.

http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Security

Best regards,
Konstantin Kolinko

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


Mime
View raw message