2017-10-13 222 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

回答