Spring-Data-JPA throws XSD validation error in Spring STS using XML config

Eclipse / STS reports errors using Spring 3.2.1 with Spring-data-jpa together. I have XML configuration files with the following header:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/data/jpa
    http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">

      

I am using Spring 3.2.1 with Spring-Data-JPA 1.3.0 and Eclipse / STS reports this:

The linked file contains errors ( http://www.springframework.org/schema/data/jpa )

This happens in every XML configuration file that contains the data-jpa schema. When I remove JPA from XML config everything is just fine.

Is my configuration wrong or what is going on here?

Thank! Floor

+3


source to share


1 answer


There is no file today http://www.springframework.org/schema/data/jpa/spring-jpa.xml so you need to use http://www.springframework.org/schema/data/jpa/spring-jpa-1.3 .xsd , but this file uses http://www.springframework.org/schema/data/repository/spring-repository.xsd , which does not exist, so you need to add the location of this schema in your context file:



xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans.xsd
                    http://www.springframework.org/schema/jdbc
                    http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
                    http://www.springframework.org/schema/data/jpa
                    http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
                    http://www.springframework.org/schema/data/repository
                    http://www.springframework.org/schema/data/repository/spring-repository-1.5.xsd
                    http://www.springframework.org/schema/jee
                    http://www.springframework.org/schema/jee/spring-jee-3.2.xsd"

      

+6


source







All Articles