无法访问Internet,需要Spring XSD吗?

问题描述 投票:0回答:1

我试图在没有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解析器从本地资源加载?

spring citrus-framework
1个回答
0
投票

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

但是请确保在项目类路径中具有spring-aop依赖项。通常,Spring将解析类路径中的模式位置,因为spring.handlersspring.schemas在Spring jar文件中打包在META-INF中。虽然我不确定旧版本的Spring如何表现。

© www.soinside.com 2019 - 2024. All rights reserved.