Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to read schema document ".../spring-repository.xsd" #32

Closed
sebdavid opened this issue Oct 1, 2015 · 3 comments
Closed

Failed to read schema document ".../spring-repository.xsd" #32

sebdavid opened this issue Oct 1, 2015 · 3 comments
Assignees
Labels
in: docs An issue in Documentation or samples type: enhancement
Milestone

Comments

@sebdavid
Copy link

sebdavid commented Oct 1, 2015

Hi !

I'm using v2.0.4.RELEASE of spring-ldap-core, referencing it as written in the doc :

    <dependency>
        <groupId>org.springframework.ldap</groupId>
        <artifactId>spring-ldap-core</artifactId>
        <version>2.0.4.RELEASE</version>
    </dependency>

I'm using it with other Spring librairies (jdbc, context, tx, and web) in version 4.2.1.RELEASE, but NOT with Spring security.

When the Spring context is loadded, the following error is thrown :

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/data/repository/spring-repository.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.

The begin of my XML Spring context is :

<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:ldap="http://www.springframework.org/schema/ldap"
    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/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd">

Indeed, the spring-ldap-2.0.xsd contains the following which can not be found :

    <xs:import namespace="http://www.springframework.org/schema/data/repository"
                schemaLocation="http://www.springframework.org/schema/data/repository/spring-repository.xsd" />

After some search it seems that the missing xsd is in spring-data-commons, specified as "optional" in the spring-ldap-core pom.xml. So should I really add spring-data-commons as a dependency in my project ?

@RadouaneRoufid
Copy link

RadouaneRoufid commented Aug 9, 2016

I'm facing the same problem with the lastest version of spring-ldap-core

        <dependency>
            <groupId>org.springframework.ldap</groupId>
            <artifactId>spring-ldap-core</artifactId>
            <version>2.1.0.RELEASE</version>
        </dependency>

I didn't found any direct solution to fix it. I really don't need the spring-data-commons dependency in my project but adding it solved my problem !

@arey
Copy link

arey commented Apr 12, 2021

Still have the same issue with spring-ldap-core 2.3.3.RELEASE

@rwinch rwinch added this to the 2.3.4 milestone Apr 13, 2021
@rwinch rwinch added the type: bug A general bug label Apr 13, 2021
@rwinch rwinch modified the milestones: 2.3.4, 2.3.5 May 14, 2021
@jzheaux jzheaux modified the milestones: 2.3.5, 2.3.6 Dec 17, 2021
@jzheaux
Copy link
Contributor

jzheaux commented Feb 17, 2022

That is correct that it is a required dependency when using Spring LDAP's XML config support since it extends Spring Data's repositories element definition. Since not everyone uses XML config, it needs to remain an optional dependency.

The documentation explains that spring-data-commons is required, but it's not entirely accurate. I think a documentation update could help to clarify.

jzheaux added a commit that referenced this issue Feb 17, 2022
Otherwise, the XSD cannot find spring-repository.

Issue gh-32
jzheaux added a commit that referenced this issue Feb 17, 2022
jzheaux added a commit that referenced this issue Feb 17, 2022
Otherwise, the XSD cannot find spring-repository.

Issue gh-32
jzheaux added a commit that referenced this issue Feb 17, 2022
Otherwise, the XSD cannot find spring-repository.

Issue gh-32
jzheaux added a commit that referenced this issue Feb 17, 2022
@jzheaux jzheaux modified the milestones: 2.3.6, 2.4.0-M2 Feb 17, 2022
@jzheaux jzheaux added in: docs An issue in Documentation or samples type: enhancement and removed type: bug A general bug labels Feb 17, 2022
@jzheaux jzheaux self-assigned this Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples type: enhancement
Projects
None yet
Development

No branches or pull requests

5 participants