我正在使用 OC4J 10.1.3.5.0,并且在 WAR/EAR 中提供的 Spring XML 文件中的 XML 命名空间存在问题。
根据 Oracle 文档,在 OC4J 中解析 Spring 3 XSD 文件时存在一个已知问题,因为它嵌入了 Oracle XMLParserV2 jar 并将其用于所有 XML 解析(显然 Spring 3 中使用的一些 XSD 技巧存在问题)。
我遵循了 Oracle 解决方法,在 OC4J 实例上定义了我自己的 XML 解析器共享库,并且(在 orion-application.xml 中)定义了要使用的共享库。我使用 xercesImpl (v 2.9.1)、xml-apis (v 1.3.04) 和 xml-resolver (v 1.2) 创建了一个共享库“apache.xml”。我尝试定义 EAR 以使用新库
<imported-shared-libraries>
<imported-shared-library name="apache.xml"/>
</imported-shared-libraries>
我收到以下错误
14:50:31 ERROR (UserId:) [DispatcherServlet] Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 10 in XML document from ServletContext resource [/WEB-INF/spring/webflow-config.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c:
The matching wildcard is strict, but no declaration can be found for element 'webflow:flow-executor'.
webflow-config.xml 文件被定义为正常:
<?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:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
<!-- Executes web flows -->
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry" />
<!-- Rest of the file ... -->
</beans>
有没有人有任何想法?
[编辑]片段:
<imported-shared-libraries>
<imported-shared-library name="apache.xml"/>
</imported-shared-libraries>
当然应该阅读:
<imported-shared-libraries>
<import-shared-library name="apache.xml"/>
</imported-shared-libraries>
对不起!