Results 1 to 8 of 8

Thread: Facing a problem converting @Bean to xml configuration for Facebook integration

Threaded View

  1. #1
    Join Date
    Aug 2010
    Posts
    7

    Default Facing a problem converting @Bean to xml configuration for Facebook integration

    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/sprin...onnecting.html and have made the changes for the other @Beans. But I am not sure how to convert the following @Bean to xml form -

    Code:
    @Bean
    @Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)	
    public Facebook facebook() {
        return connectionRepository().getPrimaryConnection(Facebook.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.
    Last edited by vijay.olety; Jul 22nd, 2011 at 02:26 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •