I have been following a few threads in wicket-users wrt to implementing 404 error pages but I've run into an issue where the Spring configuration does not seem to be in context of the request when executing through the ERROR dispatcher.
The exception I'm hitting is: > org.apache.wicket.RequestCycle - > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'userContext': Scope 'session' is not active for the > current thread; consider defining a scoped proxy for this bean if you > intend to refer to it from a singleton; nested exception is > 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. > The page itself renders without issue when requested directly (/app/errors/404) but the exception above is thrown in the event of an actual 404 error (/app/nosuchpage) The relevant parts of our configuration follows. Any advice or pointers would be greatly appreciated. --adam --- web.xml --- <!-- Spring --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <!-- Wicket --> <filter> <filter-name>WicketFilter</filter-name> <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class> <init-param> <param-name>applicationFactoryClassName</param-name> <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value> </init-param> </filter> <filter-mapping> <filter-name>WicketFilter</filter-name> <url-pattern>/app/*</url-pattern> <dispatcher>ERROR</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping> <error-page> <error-code>404</error-code> <location>/app/errors/404</location> </error-page> -- View this message in context: http://www.nabble.com/Invalid-Spring-Context-with-ERROR-dispatcher--tp18858223p18858223.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]