2013-04-09 15 views
5

XMLを使用してSpring Social Showcaseを試しましたが、XMLにエラーがあるようです。SpringSocial XML設定スキーマエラー

XMLファイルが機能していません。私は、スキーマ(http://www.springframework.org/schema/social/)とURLでそれを貼り付けをチェックしようとした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/> 

にライン23上の×印を読みましたが、それは、それが見つからないということを述べています。 私は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> 
+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> 

を変更するには? –

+0

私はSpring Social 1.1.0バージョンを使用しています。ダウングレードする必要がありますか? – waterfall37

+0

1.1.0.M1を意味しますか? 1.1.0.M2?最新のものを試してみてください。 jarファイル内の対応するxsdファイルの存在を確認します。それがうまくいかない場合は、スナップショットビルドを[this](https://github.com/SpringSource/spring-social-samples/blob/master/spring-social-showcase-xml/pom.xml)に表示されるように試すことができます)例です。本番用のアプリケーションをビルドすると、1.0.2.RELEASEにダウングレードする方が良いでしょう(xml名前空間のサポートはありませんが、今は大きな利点はありません) –

答えて

1

が、私は今、同じ問題に出くわしました。

ビルドパスにSpring-Social-Security jarを追加するだけで解決しました。 Mavenので:

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

それは助けてくれましたが、「usersConnectionRepository」という名前のBeanは定義されていないという別の問題があります。 – digz6666

0

てみ

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