XMLからConfigrationクラスに初期化を移動した。

ConnectionRepositoryの初期化をxmlで行っていたけど、
#{request.userPrincipal.name}の部分がおかしいようなので、
Configureクラスに移動してspringsecurityから持ってきているConfigurationクラス内で初期化するように変えてみた
今度はDBにエラーが出た模様(-w-;
テーブル内に何か持っている感じのエラーでした。
もうチョイ調べないと(-w-;


@Autowired
private UsersConnectionRepository usersConnectionRepository;

@Bean
@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
public ConnectionRepository connectionRepository(){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication == null) {
throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
}
return usersConnectionRepository.createConnectionRepository(authentication.getName());
}

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select userId, providerId, providerUserId, displayName, profileUrl, imageUrl, accessToken, secret, refreshToken, expireTime from UserConnection where userId = ? and providerId = ? and rank = 1]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'happyshare.userconnection' doesn't exist
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:233)
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:718)
org.springframework.social.connect.jdbc.JdbcConnectionRepository.findPrimaryConnection(JdbcConnectionRepository.java:195)
org.springframework.social.connect.jdbc.JdbcConnectionRepository.getPrimaryConnection(JdbcConnectionRepository.java:149)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)