--- Niral Trivedi <[EMAIL PROTECTED]> wrote: > We are trying to have Spring manage all the value objects and action > objects. And so followed steps in Struts document to add struts2-spring > plugin jar and made necessary changes but getting errors when try to create > a bean in session scope. Following are my configuration files: > [...] > [1/18/08 23:49:51:855 EST] 00000032 WebApp E [Servlet > Error]-[Error > creating bean with name 'scopedTarget.mVO': 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.]: > [...] > So, I tried changing web.xml and replace > org.springframework.web.context.ContextLoaderListener with > org.springframework.web.context.request.RequestContextListener. At that > point, server starts up correctly, but while accessing action class, I am > getting error message saying :
The reference manuals for both 2.0 and 2.5 say to *add* the RequestContextListener [1,2], not to remove the listener that sets up your application context. I'd recommend perusing the reference doc a bit more and also checking the API documentation for both ContextLoaderListener [3] and RequestContextListener [4] to understand what each of them do. d. [1] http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#beans-factory-scopes-other [2] http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes-other [3] http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/context/ContextLoaderListener.html [4] http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/context/request/RequestContextListener.html [tags: s2, spring, config, scope] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]