2017-10-13 240 views
0

我使用spring jdbc:embedded-database xml config进行JUNIT测试。春天的版本是4.3.3.RELEASE。 当我尝试在JBoss的开发工作室7.1.1.GA XML弹簧JDBC来配置我有以下问题:在这条线找到JBOSS EAP和SPRING:spring-jdbc问题

多个批注: - schema_reference.4:无法读取模式文档'http://www.springframework.org/schema/jdbc/spring-jdbc.xsd', 因为1)找不到文档; 2)文件不能被 读取; 3)文档的根元素不是。 - cvc-complex-type.2.4.c:匹配通配符是严格的,但是对元素'jdbc:embedded-database'没有声明。

发生故障的配置如下

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

    ... 
    <jdbc:embedded-database id="dataSource" type="H2" /> 

相反,使用

http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd"> 

的JBoss Developer Studio中不给错误。

此外,我注意到,只有从JBoss Developer Studio用户界面出现错误,如果我从maven启动测试(或安装),我没有任何错误。

我该如何解决这个问题? 感谢您的帮助。

+0

没有的JBoss EAP 7.1.1。你使用JBoss AS 7.1.1.Final吗? –

+0

对不起,我的错。我指的是JBoss开发工作室7.1.1.GA – Massimo

回答