0
votes

I define a bean with scope request and get an error when i start my application:

"Cannot resolve reference to bean 'accountDS' while setting bean property 'accountDS'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountDS': Scope 'request' 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"

I am using this bean from within my controller which is a singleton. Is this why i can't get a request? If so how can i create a scoped proxy? I also have RequestContextListener in my web.xml but it doesn't help.

    <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
1
Can you post your spring context?beny23

1 Answers

4
votes
<bean id="..." class="..." scope="request">
<aop:scoped-proxy />
</bean>