无法访问互联网,Spring XSD需要什么?

时间:2018-03-01 09:59:55

标签: spring citrus-framework

我正在尝试在没有Internet访问的环境中运行一些Citrus测试。我的测试是TestNGCitrusTestBuilder的子类。现在,当我运行测试时,我收到此错误消息:

INFO: Loading XML bean definitions from class path resource [com/consol/citrus/spring/root-application-ctx.xml]
Mär 01, 2018 9:50:18 AM org.springframework.util.xml.SimpleSaxErrorHandler warning
WARNING: Ignored XML validation warning
org.xml.sax.SAXParseException; lineNumber: 26; columnNumber: 29; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/aop/spring-aop.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>.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

导致问题的XML文档位于citrus-core-1.4.jar中。根元素如下所示:

 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

因此,XML解析器是请求访问此文档的权利。问题:如何激活某些解析器,或者其他什么,从而使XML解析器从本地资源加载?

1 个答案:

答案 0 :(得分:0)

柑橘1.4?这已经快四年了。没有机会更新到更新的版本? 2.7.3是最新的Citrus版本。我很肯定,Citrus和Spring的新版本问题已经消失。

但请确保您的项目类路径中具有getPosts(): Observable<Npb[]> { //See that I use httpClient return this.httpClient .get(this._postsURL) .map((response: any) => { //see that we received response:any return response[0].rates; }) } 依赖项。通常,Spring将解析类路径中的模式位置,因为spring-aopspring.handlers打包在Spring jar文件中的META-INF中。虽然我不确定Spring的旧版本是如何表现的。