On 27.12.2006 19:05, Reinhard Poetz wrote:
I removed our own implementation in favour of Spring's
RequestContextHolder. The attributes are used to keep track of poolable
components and to release them when the request is finished.
Therefore you should add the Spring's request context listener to your
web.xml (I added it to web.xml in svn); this listener requires servlet
spec 2.4.
For some reasons the use of the
org.springframework.web.context.request.RequestContextListener caused
this exception:
java.lang.IllegalStateException: No thread-bound request found: Are you
referring to request attributes outside of an actual web request? If you
are actually operating within a web request and still receive this
message,your code is probably running outside of
DispatcherServlet/DispatcherPortlet: In this case, use
RequestContextListener or RequestContextFilter to expose the current
request.
That's the descriptive exception I talked about when
RequestContextHolder does actually not hold a RequestAttributes
instance. It's caused by the mentioned null check instead of the NPE you
got.
If you use web.xml as is (the one you committed, [1]) the Listener does
not work because of servlet 2.3 while you need 2.4. IIRC we decided to
switch to 2.4, so it would be better to change the DTD/schema
declaration to 2.4 in that web.xml.
Regards
Jörg
[1]
http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml?revision=490547&view=markup&pathrev=490547