我正在尝试将我的春季版本从“4.1.5.RELEASE”升级到“5.0.3.RELEASE”(最新版本)。
当我转到“4.2.1.RELEASE”以外的任何版本时,我收到以下错误:
原因:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:类路径资源[SpringConfig.xml]的XML文档中的第676行无效;嵌套异常是 org.xml.sax.SAXParseException;系统ID:http ://www.jasypt.org/schema/encryption/jasypt-spring31-encryption-1.xsd ;行号:676;列号:67;src-resolve:无法将名称“context:propertyPlaceholder”解析为(n)“类型定义”组件。
原因:org.xml.sax.SAXParseException:src-resolve:无法将名称“context:propertyPlaceholder”解析为(n)“类型定义”组件。
我已经追踪到 Spring 人员从发布“4.2.2.RELEASE”开始在他们的 spring-context-4.2.xsd 中将“propertyPlaceholder”类型重命名为“propertyLoading”。
我正在使用的 JASypt 组件扩展了 propertyPlaceholder 类型,并且此引用导致了错误。参考可以从这个 URL 看到:
http://www.jasypt.org/schema/encryption/jasypt-spring31-encryption-1.xsd
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="context:propertyPlaceholder">
<xsd:attribute name="encryptor" type="xsd:string" use="required">
它们包括更旧版本的 spring-context XSD 文件(版本 3.1):
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"/>
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.1.xsd"/>
<xsd:import namespace="http://www.springframework.org/schema/context" schemaLocation="http://www.springframework.org/schema/context/spring-context-3.1.xsd"/>
由于我不“控制”此 XSD,因此克服此错误的最简单方法是什么?谢谢。