Which version of Spring Social are you using?
The samples are updated to reflect the latest 1.1.0.M2 releases, but the manual has not yet been updated (primarily because I want to shake out any issues before I document them).
The way you configured the JdbcUsersConnectionRepository looks *mostly* correct, but it's not enough. There are two kinds of connection repositories: The UsersConnectionRepository and the ConnectionRepository. You've configured the first kind, but ConnectController wants the 2nd kind. Actually, you need to configure both:
Code:
<bean id="usersConnectionRepository" class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
<constructor-arg ref="dataSource" />
<constructor-arg ref="connectionFactoryLocator" />
<constructor-arg ref="textEncryptor" />
<aop:scoped-proxy proxy-target-class="false" />
</bean>
<bean id="connectionRepository" factory-method="createConnectionRepository" factory-bean="usersConnectionRepository" scope="request">
<constructor-arg value="#{request.userPrincipal.name}" />
<aop:scoped-proxy proxy-target-class="false" />
</bean>
(Note: Depending on your security mechanism, you might need to tweak the SpEL expression that fetches the username.)
If it helps, think of the UsersConnectionRepository as a "ConnectionRepository factory". It's a bit more than that, but that's one of its primary jobs--to create a connection repository for the current user. It's that 2nd bean that ConnectController wants, but you need the first one to create it for you.
I acknowledge that this can be confusing. From a design standpoint it makes sense. But from a configuration standpoint it's a bit awkward. That's why Spring Social 1.1.0.M1 introduced the new configuration namespace (and JavaConfig annotations) to free you from having to deal with those beans directly. But if you're still on 1.0.x, then you must do it the hard way.
I also should warn you that if you are doing it the hard way on 1.0.x, that the XML configuration is a bit trickier. The JavaConfig is easier for 1.0.2. I wonder why you are hesitant to use JavaConfig...even if just for those two beans and use XML for the rest of your app?
Craig Walls
Spring Social Project Lead