Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpringSocial XML Configuration Schema Error

I tried the Spring Social Showcase using XML but it appears to have an error in the XML.

The XML file is not working. I have read x marks on line 23 to 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/>

I tried to check the schema ( http://www.springframework.org/schema/social/ )and pasted it in the URL but it says it that it is not found. I tried to check the root which is springframework.org/schema/ and I was not able to find a child relating to Spring Social.

Is there a new link for the xmnls or schema location for spring social?

Here is my XML File:

<?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>
like image 212
waterfall37 Avatar asked Apr 09 '13 06:04

waterfall37


2 Answers

It's been some time since the question was asked, but I came across the same problem now.

I fixed it simply by adding Spring-Social-Security jar to my buildpath. With maven:

<dependency>
  <groupId>org.springframework.social</groupId>
  <artifactId>spring-social-security</artifactId>
  <version>${org.springframework.social-version}</version>
</dependency>
like image 125
gerry Avatar answered Oct 27 '22 22:10

gerry


Try to change this part

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

With

    <bean class="org.springframework.social.web.connect.ConnectController">
<constructor-arg value="${application.url}" /></bean>
like image 35
Stojan Končar Avatar answered Oct 27 '22 22:10

Stojan Končar