春季社交bean未在Spring 4.3.5中注册

时间:2017-05-01 17:42:26

标签: spring spring-mvc spring-social

我今天尝试从Spring 4.3.1更新到Spring 4.3.8 for Spring MVC Web应用程序,它也使用了Spring Social 1.1.4和Java8。 这在启动时失败并出现错误:

Error creating bean with name 'MySocialConfig': Unsatisfied
dependency expressed through method 'setSocialConfigurers' parameter   0; nested exception is 

org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type '   java.util.List<org.springframework.social.config.annotation.SocialConfigu rer>' available:  
 expected at least 1 bean which qualifies as autowire   candidate. Dependency annotations: {}

更新到4.3.4很好。但是任何版本的&gt; = 4.3.5在bean初始化时都会因此错误而失败。

这是我的社交配置课程:

@Configuration
@EnableSocial
public class MySocialConfig extends SocialConfiguration implements SocialConfigurer {
      // some methods implemented according to SpringSocial docs:
   E.g. 

   @Override
    public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {     
        configureXXX(cfConfig);   
        configureYYY(cfConfig); 
    } 
   }

在更新到Spring 4.3.5或更高版本时,有没有其他人遇到@Configuration类的问题?谢谢 理查德

1 个答案:

答案 0 :(得分:3)

您不需要扩展SocialConfiguration(因为您正在使用if r.text does not contain "error" then continue on my doe else send an email telling me the error code 它用于将此注释添加到@Configuration类,以便在SocialConfiguration中导入Spring MVC配置。)而不是您可以扩展SocialConfigurerAdapter - &gt;

@EnableSocial

Here是春天社交的好例子

相关问题