SpringSocial XML配置架构错误

时间:2013-04-09 06:41:06

标签: xml spring config spring-social

我尝试使用XML进行Spring Social Showcase,但它似乎在XML中有错误。

XML文件无效。我在第23到27行读了x标记。

<facebook:config app-id="${facebook.clientId}" app-secret="${facebook.clientSecret}" app-namespace="socialshowcase" />
    <twitter:config app-id="${twitter.consumerKey}" app-secret="${twitter.consumerSecret}"/>
    <linkedin:config app-id="${linkedin.consumerKey}" app-secret="${linkedin.consumerSecret}"/>

    <social:jdbc-connection-repository/>

我尝试检查架构(http://www.springframework.org/schema/social/)并将其粘贴到网址中,但它说它未找到。 我试图检查springframework.org/schema/的根目录,但我找不到与Spring Social有关的孩子。

是否有针对spring social的xmnls或架构位置的新链接?

这是我的XML文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:facebook="http://www.springframework.org/schema/social/facebook"
    xmlns:twitter="http://www.springframework.org/schema/social/twitter"
    xmlns:social="http://www.springframework.org/schema/social"
    xmlns:linkedin="http://www.springframework.org/schema/social/linkedin"
    xmlns:c="http://www.springframework.org/schema/c"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/social/facebook http://www.springframework.org/schema/social/spring-social-facebook.xsd
        http://www.springframework.org/schema/social/linkedin http://www.springframework.org/schema/social/spring-social-linkedin.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/social/twitter http://www.springframework.org/schema/social/spring-social-twitter.xsd
        http://www.springframework.org/schema/social http://www.springframework.org/schema/social/spring-social.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">



    <context:property-placeholder location="classpath:/org/springframework/social/showcase/config/application.properties" />



    <facebook:config app-id="${facebook.clientId}" app-secret="${facebook.clientSecret}" app-namespace="socialshowcase" />
    <twitter:config app-id="${twitter.consumerKey}" app-secret="${twitter.consumerSecret}"/>
    <linkedin:config app-id="${linkedin.consumerKey}" app-secret="${linkedin.consumerSecret}"/>

    <social:jdbc-connection-repository/>    
    <bean id="userIdSource" class="org.springframework.social.security.AuthenticationNameUserIdSource" />

    <bean id="connectController" class="org.springframework.social.connect.web.ConnectController" autowire="constructor">
        <property name="connectInterceptors">
            <list>
                <bean class="org.springframework.social.showcase.facebook.PostToWallAfterConnectInterceptor" />
                <bean class="org.springframework.social.showcase.twitter.TweetAfterConnectInterceptor" />
            </list>
        </property>
    </bean>

    <bean id="psc" class="org.springframework.social.connect.web.ProviderSignInController" autowire="constructor" />        
    <bean id="signInAdapter" class="org.springframework.social.showcase.signin.SimpleSignInAdapter" autowire="constructor" />

    <bean id="disconnectController" class="org.springframework.social.facebook.web.DisconnectController" 
        c:_0-ref="usersConnectionRepository" c:_1="${facebook.clientSecret}" />

</beans>

2 个答案:

答案 0 :(得分:1)

问题问题已经有一段时间了,但我现在遇到了同样的问题。

我只是通过在我的buildpath中添加Spring-Social-Security jar来修复它。随着maven:

<dependency>
  <groupId>org.springframework.social</groupId>
  <artifactId>spring-social-security</artifactId>
  <version>${org.springframework.social-version}</version>
</dependency>

答案 1 :(得分:0)

尝试更改此部分

<bean id="connectController" class="org.springframework.social.connect.web.ConnectController" autowire="constructor">
    <property name="connectInterceptors">
        <list>
            <bean class="org.springframework.social.showcase.facebook.PostToWallAfterConnectInterceptor" />
            <bean class="org.springframework.social.showcase.twitter.TweetAfterConnectInterceptor" />
        </list>
    </property></bean>

使用

    <bean class="org.springframework.social.web.connect.ConnectController">
<constructor-arg value="${application.url}" /></bean>