2013-04-09 4 views
5

Ich habe die Spring Social Showcase mit XML versucht, aber es scheint, einen Fehler in der XML zu haben.SpringSocial XML-Konfigurationsschema-Fehler

Die XML-Datei funktioniert nicht. Ich habe x Markierungen auf Zeile gelesen 23 bis 27.

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

Ich habe versucht, das Schema (http://www.springframework.org/schema/social/) und klebte es in der URL zu überprüfen, aber es sagt, dass es nicht gefunden wird. Ich habe versucht, die Wurzel zu überprüfen, die springframework.org/schema/ ist, und ich war nicht in der Lage, ein Kind in Bezug auf Spring Social zu finden.

Gibt es einen neuen Link für den XMNLS oder den Schema-Speicherort für spring social?

Hier ist meine XML-Datei:

<?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> 
+0

Welche Version von Spring Social verwenden Sie? –

+0

benutze Spring Social 1.1.0 Version. Muss ich downgraden oder was? – waterfall37

+0

Meinst du 1.1.0.M1? oder 1.1.0.M2? Probiere das Neueste aus. Überprüfen Sie das Vorhandensein der entsprechenden Xsd-Datei im Jar. Wenn es nicht für Sie funktioniert, können Sie Schnappschuss-Builds wie in [this] (https://github.com/SpringSource/spring-social-samples/blob/master/spring-social-showcase-xml/pom.xml) ausprobieren) Beispiel. Wenn Sie eine App für die Produktion erstellen, ist es besser, auf 1.0.2.RELEASE herunterzustufen (es gibt keinen XML-Namespace-Support, aber ich sehe gerade keinen großen Vorteil) –

Antwort

1

es einige Zeit her, seit die Frage gestellt wurde, aber ich kam in das gleiche Problem jetzt.

Ich habe es einfach durch Hinzufügen von Spring-Social-Security Glas zu meinem Buildpath behoben. Mit Maven:

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

Es hat mir geholfen, aber ich habe ein anderes Problem, das besagt, dass kein Bean namens 'usersConnectionRepository' definiert ist. – digz6666

0

Versuchen Sie, diesen Teil ändern

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

mit

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