Hi there,
we are playing around with Cuba lately to evaluate its values for our business. So far, not bad!
However, I struggle with a tiny issue for some time now and haven’t found a solution to overcome this yet. Given I have a typical Spring configuration, in this case for spring-social:
@EnableSocial
@Configuration
public class SocialConfiguration implements SocialConfigurer {
...
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
SocialUserConnectionRepository socialUserConnectionRepository = AppBeans.get(Repositories.class).get(SocialUserConnectionRepository.class);
UserRepository userRepository = AppBeans.get(Repositories.class).get(UserRepository.class);
return new CustomSocialUsersConnectionRepository(socialUserConnectionRepository, userRepository, connectionFactoryLocator);
}
}
I cannot overcome the issue of:
Failed to instantiate [org.springframework.social.connect.UsersConnectionRepository]: Factory method 'usersConnectionRepository' threw exception; nested exception is java.lang.IllegalStateException: Application context is not initialized
How to go about this? How can I ensure the persistence layer is up and runnig when I want to configure something that relies on it?