2013-04-09 14 views
5

Ho provato lo Spring Social Showcase utilizzando XML ma sembra che abbia un errore nell'XML.SpringSocial XML Configuration Schema Error

Il file XML non funziona. Ho letto segni x sulla linea 23 a 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/> 

ho cercato di controllare lo schema (http://www.springframework.org/schema/social/) e incollato nella URL, ma si dice che che non si trova. Ho provato a verificare la radice che è springframework.org/schema/ e non sono riuscito a trovare un bambino relativo a Spring Social.

C'è un nuovo collegamento per xmnls o posizione schema per social di primavera?

Ecco il mio file 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> 
+0

Quale versione di Spring sociale si usa? –

+0

con la versione Spring Social 1.1.0. Devo effettuare il downgrade o cosa? – waterfall37

+0

Intendi 1.1.0.M1? o 1.1.0.M2? Prova l'ultimo. Controlla la presenza del file xsd corrispondente nel barattolo. Se non funziona per te, puoi provare le build di istantanee come mostrato in [questo] (https://github.com/SpringSource/spring-social-samples/blob/master/spring-social-showcase-xml/pom.xml) esempio. Se costruisci qualche app per la produzione, allora sarà meglio effettuare il downgrade a 1.0.2.RELEASE (non esiste un supporto per lo spazio dei nomi xml, ma al momento non vedo alcun grosso vantaggio) –

risposta

1

E 'passato un po' di tempo da quando la questione è stato chiesto, ma mi sono imbattuto lo stesso problema ora.

L'ho risolto semplicemente aggiungendo il jar Spring-Social-Security al mio buildpath. Con Maven:

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

Mi ha aiutato ma ho un altro problema che dice che nessun bean chiamato 'usersConnectionRepository' è definito. – digz6666

0

cerchiamo di cambiare questa parte

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

Con

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