SpringSocial XML Configuration Schema Error
Asked Answered
D

2

6

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>
Deflation answered 9/4, 2013 at 6:41 Comment(5)
What version of Spring Social do you use?Watson
im using Spring Social 1.1.0 version. Do I need to downgrade or what?Deflation
Do you mean 1.1.0.M1? or 1.1.0.M2? Try the latest one. Check the presence of corresponding xsd file in the jar. If it's not work for you then you can try snapshot builds as showen in this example. If you build some app for production then it will be better to downgrade to 1.0.2.RELEASE (there is no xml namespace support, but I am do not see some big advantage right now)Watson
Tried everything you said ( like changing to that lastest one or trying those builds ) but still no luck in removing the red X in those line in the XML. But the weird thing is that when I tried to run it, the console does not create such errors regarding those. The application is actually working fine but there's a red X. How come?Deflation
Try to force update validation results in your IDE. In a case of Eclipse try Project -> Clean...-> Clean all projects.Watson
P
1

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>
Palazzo answered 22/10, 2013 at 9:27 Comment(1)
It helped me but I have another issues which says no bean named 'usersConnectionRepository' is defined.Donniedonnish
S
1

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>
Shanteshantee answered 14/1, 2014 at 15:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.