xml - Spring 数据 xml 配置模式验证错误

标签 xml eclipse spring spring-data

我有一个项目使用 Spring (context, transaction, apect) 4.1.6.RELEASE 和 spring-data-jpa 1.8.0.RELEASE 并遇到奇怪的错误,假设是由 xsd 验证引起的。但是,我无法找出原因。奇怪的是,项目运行良好,我所有的 bean 都被正确识别。

我正在使用 Eclipse luna 和 Spring Tools Suite 插件

我删除了我的 applicationContext.xml 中的所有内容,除了导致问题的“jpa:”行。 xml 已使用 STS 插件创建。

我试图从 xsds 中删除版本号,但没有成功。

enter image description here

最佳答案

我前段时间遇到了同样的问题,都是jpa的东西导致的错误 我将 jpa 配置移到了一个新的配置文件中

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    default-destroy-method="destroy"
    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-4.1.xsd
        http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.8.xsd">

    <context:component-scan base-package="com.some.validator" />
    <context:component-scan base-package="com.some.security.rest" />
    <jpa:repositories base-package="com.some.repository.path"
        entity-manager-factory-ref="entityManagerFactory" />
</beans>

一些 maven 导入:

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>1.8.2.RELEASE</version>
    </dependency>

和spring框架版本

    <org.springframework-version>4.1.7.RELEASE</org.springframework-version>

尝试清理项目并使用 maven 更新它

关于xml - Spring 数据 xml 配置模式验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33430658/

相关文章:

spring - @CacheEvict 在 SpringBoot 中不起作用

android - 如何创建水平滚动按钮/ TextView ,单击时在背景中以椭圆形突出显示

xml - 用于跨多个子节点检查属性值的 XPath 表达式

java - eclipse中的.sql文件,将其显示为表格?

java - 使用不同的定位器定位 WebElement(NoSuchElementException)

java - 性能/负载/压力测试编排层

java - 处理两种情况的 XPath 1.0 查询

objective-c - 如何在不关闭标签的情况下解析XML数据Objective-C

java - 防止将eclipse项目中的授权数据保存到存储库

java - SPRING - @Autowired 和 @Service 不起作用