xml spring social xmlns:facebook

时间:2015-04-08 12:37:10

标签: spring spring-social-facebook

我想使用spring social构建一个登录,并且我已经在下一个配置中实现了* xml whit,但是网址http://www.springframework.org/schema/social/facebook是错误的?

    <?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.xsd">


    <context:property-placeholder location="classpath:/itrippingWeb/src/main/resources/application.properties" />

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


    <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>

这个xml将检索下一个异常:

Multiple annotations found at this line:
    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 
     'facebook:config'.
    - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/social/spring-
     social-facebook.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element 
     of the document is not <xsd:schema>.

有人知道这个问题吗?

谢谢!!!!

2 个答案:

答案 0 :(得分:0)

我认为这与你的pom遗漏了一些依赖关系。 你的依赖是春天的社会保障吗?

 <dependency>
     <groupId>org.springframework.social</groupId>
   <artifactId>spring-social-security</artifactId>
<version>1.1.0.RELEASE</version>

这是一个类似的应用程序,其配置与上面的spring xml相同。这是它使用的pom https://github.com/spring-projects/spring-social-samples/blob/master/attic/spring-social-showcase-xml/pom.xml

这是对通过修复pom依赖关系https://github.com/spring-projects/spring-social-facebook/issues/79

解决的类似错误的引用

答案 1 :(得分:0)

其实是网址&#34; http://www.springframework.org/schema/social/facebook&#34;链接到无处。

我找到了另一个架构文件位置:http://docs.spring.io/autorepo/schema/

我用了#34; http://docs.spring.io/autorepo/schema/spring-social/current/social/spring-social.xsd&#34;它适用于我。