Hi All,
I am using spring 2.0 and in my application i wanted to test the scope of session for the same. For that I have given scope="session" in applicationcontext.xml but while running the app I am getting error.
aused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'HibernateBean': 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.
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:733)
at org.springframework.web.jsf.DelegatingVariableReso lver.resolveVariable(DelegatingVariableResolver.ja va:122)
at org.apache.myfaces.el.ValueBindingImpl$ELVariableR esolver.resolveVariable(ValueBindingImpl.java:570)
at org.apache.commons.el.NamedValue.evaluate(NamedVal ue.java:124)
at org.apache.commons.el.ComplexValue.evaluate(Comple xValue.java:140)
at org.apache.myfaces.el.ValueBindingImpl.getValue(Va lueBindingImpl.java:386)
... 294 more
Caused by: 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.
at org.springframework.web.context.request.RequestCon textHolder.currentRequestAttributes(RequestContext Holder.java:102)
at org.springframework.web.context.request.SessionSco pe.get(SessionScope.java:88)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:285)
... 301 more
If someone can help me out that would be the greate help
Thanks in advance.


Reply With Quote