xmlでorg.springframework.social.facebook.api.Facebookを初期化をあきらめて@Configurationに頼る

どうしてもうまくxmlにできなかったので、
一部を@Configurationの設定クラスに変更した。

connectionRepostryまではxmlでbean定義しています。
これは、下あたりに書いてある。

http://static.springsource.org/spring-social/docs/1.0.x/reference/html/connecting.html

ここからxmlと@configurationのハイブリッド設定で何とか実行時エラーを回避

@Configuration
public class SocialConfig {


@Autowired
private ConnectionRepository connectionRepository;

@Bean
@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
public Facebook facebook() {
return connectionRepository.getPrimaryConnection(Facebook.class).getApi();
}

}