2013-04-09 43 views
5

Tôi đã thử Trình diễn xã hội mùa xuân bằng cách sử dụng XML nhưng dường như có lỗi trong XML.Lỗi lược đồ cấu hình XML SpringSocial

Tệp XML không hoạt động. Tôi đã đọc dấu x trên đường dây 23 đến 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/> 

tôi đã cố gắng để kiểm tra schema (http://www.springframework.org/schema/social/) và dán nó trong URL nhưng nó nói nó rằng nó không được tìm thấy. Tôi đã cố gắng kiểm tra thư mục gốc là springframework.org/schema/ và tôi không thể tìm thấy một đứa trẻ liên quan đến Spring Social.

Có liên kết mới cho vị trí xmnls hoặc lược đồ cho xã hội mùa xuân không?

Dưới đây là file XML của tôi:

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

Phiên bản nào của mùa xuân xã hội nào bạn sử dụng? –

+0

im bằng phiên bản Spring Social 1.1.0. Tôi có cần hạ cấp hay không? – waterfall37

+0

Ý của bạn là 1.1.0.M1? hoặc 1.1.0.M2? Hãy thử cái mới nhất. Kiểm tra sự hiện diện của tập tin xsd tương ứng trong bình. Nếu nó không hoạt động cho bạn thì bạn có thể thử các bản dựng nhanh như được hiển thị trong [this] (https://github.com/SpringSource/spring-social-samples/blob/master/spring-social-showcase-xml/pom.xml) thí dụ. Nếu bạn xây dựng một số ứng dụng để sản xuất thì sẽ tốt hơn để hạ cấp xuống 1.0.2.RELEASE (không có hỗ trợ không gian tên xml, nhưng tôi không thấy một số lợi thế lớn ngay bây giờ) –

Trả lời

1

Đã một thời gian kể từ khi câu hỏi được hỏi, nhưng tôi đi qua cùng một vấn đề bây giờ.

Tôi đã sửa nó đơn giản bằng cách thêm lọ Spring-Social-Security vào đường dẫn của tôi. Với maven:

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

Nó đã giúp tôi nhưng tôi có một vấn đề khác mà nói không có đậu tên 'usersConnectionRepository' được định nghĩa. – digz6666

0

Cố gắng thay đổi phần này

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

với

<bean class="org.springframework.social.web.connect.ConnectController"> 
<constructor-arg value="${application.url}" /></bean> 
Các vấn đề liên quan