0

Ι'm trying to implement ConnectController from Spring Social Twitter. Spring Social Facebook is working fine but when it comes to twitter I get this error error.org.thymeleaf.exceptions.TemplateInputException: Error resolving template [twitterConnect], template might not exist or might not be accessible by any of the configured Template Resolvers

This is my social Configuration class

@Configuration    
public class socialConfig {
    
        @Autowired
        DataSource dataSource;
    
        @Bean
        public ConnectionFactoryLocator addConnectionFactories() {
            ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
            registry.addConnectionFactory(new FacebookConnectionFactory("appid","appsecret"));
            registry.addConnectionFactory(new TwitterConnectionFactory("consumerKey","consumerSecret"));
            return registry;
    
        }
    
    
        @Bean
        public UsersConnectionRepository getUsersConnectionRepository() {
            return new JdbcUsersConnectionRepository(dataSource, addConnectionFactories(), Encryptors.noOpText());
    
        }
    
        @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 getUsersConnectionRepository().createConnectionRepository(authentication.getName());
        }

    
        @Bean
        public ConnectController connectController() {
            ConnectController controller = new ConnectController(addConnectionFactories(), 
            connectionRepository());
    
            controller.setViewPath("");
    
            return controller ;
        }

0 Answers0