vijay.olety
Jul 22nd, 2011, 02:22 AM
Hi,
I am using "spring-social-quickstart" code base (Spring 3.1 and Spring Social 1.0.0.RC1) for connecting to Facebook. It works fine. Now i wanted to put all @Configuration and @Bean to xml files. I referred http://static.springsource.org/spring-social/docs/1.0.x/reference/html/connecting.html and have made the changes for the other @Beans. But I am not sure how to convert the following @Bean to xml form -
@Bean
@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
public Facebook facebook() {
return connectionRepository().getPrimaryConnection(Facebo ok.class).getApi();
}
Tried a couple of things but failed. Some exceptions I get are -
1. Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDepen dencyException
2. org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'scopedTarget.Facebook': 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: 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.
Please help.
Thanks.
I am using "spring-social-quickstart" code base (Spring 3.1 and Spring Social 1.0.0.RC1) for connecting to Facebook. It works fine. Now i wanted to put all @Configuration and @Bean to xml files. I referred http://static.springsource.org/spring-social/docs/1.0.x/reference/html/connecting.html and have made the changes for the other @Beans. But I am not sure how to convert the following @Bean to xml form -
@Bean
@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
public Facebook facebook() {
return connectionRepository().getPrimaryConnection(Facebo ok.class).getApi();
}
Tried a couple of things but failed. Some exceptions I get are -
1. Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDepen dencyException
2. org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'scopedTarget.Facebook': 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: 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.
Please help.
Thanks.