2013-04-09 52 views
5

我试过使用XML的Spring Social Showcase,但它似乎在XML中有错误。SpringSocial XML配置架构错误

XML文件不起作用。我已经在网上阅读23 X标记至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/> 

我试图检查模式(http://www.springframework.org/schema/social/)和URL粘贴它,但它说,它没有找到。 我试图检查springframework.org/schema/的根目录,但我无法找到与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

你用什么版本的春天社会的? – 2013-04-09 08:32:09

+0

即时通讯使用Spring Social 1.1.0版本。我需要降级还是什么? – waterfall37 2013-04-09 14:57:49

+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命名空间支持,但我现在没有看到一些很大的优势) – 2013-04-09 15:35:35

回答

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 2014-12-09 09:31:54

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> 

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