2015-04-08 3 views
0

Я хочу создать логин с весной social, и я внедрил * xml с следующей конфигурацией, но URL http://www.springframework.org/schema/social/facebook не так ли?xml spring social xmlns: 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>. 

Кто-нибудь знает эту проблему?

спасибо !!!!

ответ

0

Я думаю, что это связано с тем, что ваша ошибка отсутствует в некоторых зависимостях. Является ли весенне-социальная защита вашей зависимостью?

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

Вот аналогичное приложение с той же конфигурации, что и ваш яровой XML выше. Вот П он использует 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

+0

Я не добавлял эту зависимость, потому что мое приложение имеет spring securityu, я переписал файл и некоторый класс и теперь работает. Спасибо – nole

+0

круто. если бы мой ответ помог, было бы здорово, если бы вы отметили его или проголосовали. –