我正在尝试将Spring-Social配置到我的spring框架中的XML文件中,但我得到了这个例外。当我加载所有类时,我得到NoSuchmethod错误,我正在尝试将其配置为xml,以便我可以防止此错误,所以请任何人给我建议相同。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactoryRegistry' defined in ServletContext resource [/WEB-INF/BookServletmvc-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.social.facebook.connect.FacebookConnectionFactory]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.social.facebook.connect.FacebookConnectionFactory.<init>()
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.social.facebook.connect.FacebookConnectionFactory]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.social.facebook.connect.FacebookConnectionFactory.<init>()
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:83)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030)
... 49 more
Caused by: java.lang.NoSuchMethodException: org.springframework.social.facebook.connect.FacebookConnectionFactory.<init>()
at java.lang.Class.getConstructor0(Class.java:2849)
at java.lang.Class.getDeclaredConstructor(Class.java:2053)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)
... 50 more
java.lang.NoSuchMethodException: org.springframework.social.facebook.connect.FacebookConnectionFactory.<init>()
at java.lang.Class.getConstructor0(Class.java:2849)
at java.lang.Class.getDeclaredConstructor(Class.java:2053)
我的配置文件是。
<bean id="connectionFactoryRegistry"
class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
<property name="connectionFactories">
<list>
<bean
class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
<constructor-arg value="${facebook.clientId}" />
<constructor-arg value="${facebook.clientSecret}" />
</bean>
</list>
</property>
</bean>
<!-- <bean class="org.springframework.social.web.connect.ConnectController">
<constructor-arg value="${application.url}" /> </bean> -->
<bean id="userConnectionRepository" factory-method="createConnectionRepository"
factory-bean="jdbcConnectionRepository" scope="request">
<constructor-arg
value="#{request.getRequestURI().split('/').length > 3 ? request.getRequestURI().split('/')[3] : 'guest'}" />
<aop:scoped-proxy proxy-target-class="false" />
</bean>
<bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
factory-method="noOpText" />
<bean id="jdbcConnectionRepository"
class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
<constructor-arg ref="dataSource" />
<constructor-arg ref="userConnectionRepository" />
<constructor-arg ref="textEncryptor" />
</bean>
<bean id="connectController"
class="org.springframework.social.connect.web.ConnectController"
autowire="constructor">
<property name="connectInterceptors">
<list>
<bean
class="org.springframework.social.facebook.connect.FacebookConnectionFactory" />
</list>
</property>
</bean>
和罐子
spring-social-security-1.1.0.M2.jar
spring-social-facebook-web-1.0.3.RELEASE.jar
spring-social-facebook-1.1.1.RELEASE.jar
spring-social-core-1.0.2.RELEASE.jar
spring-social-config-1.1.0.M4.jar
spring-security-crypto-3.1.0.RELEASE.jar