facebook schema error #79

Open
mertforpublic opened this Issue Mar 10, 2013 · 5 comments

Projects

None yet

5 participants

@mertforpublic

When i try to add spring-social to my project i get this error for social.xml.
Any suggestion for that?

Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'http://
www.springframework.org/schema/social/spring-social-facebook.xsd', because 1) could not
find the document; 2) the document could not be read; 3) the root element of the document is
not xsd:schema.
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be
found for element 'facebook:config'.

@mistic100

same here... one year later

pom.xml

        <!-- ... -->
        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-core</artifactId>
            <version>1.1.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-facebook</artifactId>
            <version>1.1.1.RELEASE</version>
        </dependency>

spring-servlet.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:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:facebook="http://www.springframework.org/schema/social/facebook"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/social/facebook http://www.springframework.org/schema/social/spring-social-facebook.xsd
    ">
    <!-- ... --->

    <facebook:config app-id="......" app-secret="......" app-namespace="......" />

</beans>
@mistic100

So I solved this error.... by rewriting the schema !
I made a copy in my classpath with this content

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.org/schema/social/facebook"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    targetNamespace="http://www.springframework.org/schema/social/facebook">

    <xsd:element name="config">
        <xsd:complexType>
            <xsd:attribute name="app-id" use="required" type="xsd:string" />
            <xsd:attribute name="app-secret" use="required" type="xsd:string" />
            <xsd:attribute name="app-namespace" use="optional" type="xsd:string" />
        </xsd:complexType>
    </xsd:element>

</xsd:schema>

The original is

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:facebook="http://www.springframework.org/schema/social/facebook"
    targetNamespace="http://www.springframework.org/schema/social/facebook">

    <xs:element name="config">
        <xs:complexType>
            <xs:attribute name="app-id" use="required" type="xs:string" />
            <xs:attribute name="app-secret" use="required" type="xs:string" />
            <xs:attribute name="app-namespace" use="optional" type="xs:string" />
        </xs:complexType>
    </xs:element>

</xs:schema>

I took the WORKING Data Mongo schema for reference when rewriting it

and in the application context file:

http://www.springframework.org/schema/social/facebook classpath:xml/spring-social-facebook-1.1.xsd
@digz6666

I added spring-social-security to my pom.xml and never have to modify the schema.

<dependency>
    <groupId>org.springframework.social</groupId>
    <artifactId>spring-social-security</artifactId>
    <version>1.1.0.RELEASE</version>
</dependency>
@Shashankk601

i tried doing that but still i am getting the same error what am i supposed to do now..plz help...!!

@habuma
Spring member

Unfortunately, I cannot recreate the issue described here. For the project I tried this with, see https://github.com/spring-projects/spring-social-samples/tree/master/attic/spring-social-showcase-xml.

I've imported this project to Spring ToolSuite and have deployed/run it in Tomcat with no troubles whatsoever (aside from the fact that the example was old and needed some updates to use the latest Spring Social stuff).

I'd like to help, but I need more info. Are you getting this error at runtime (and if so, what server)? Or is it in the IDE (and if so, which IDE)? Any details you can give would be helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment