【发布时间】:2011-02-24 15:50:41
【问题描述】:
我使用的是 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>
有人有什么想法吗?
[编辑] sn-p:
<imported-shared-libraries>
<imported-shared-library name="apache.xml"/>
</imported-shared-libraries>
当然应该阅读:
<imported-shared-libraries>
<import-shared-library name="apache.xml"/>
</imported-shared-libraries>
对不起!
【问题讨论】:
-
项目的classpath中添加了spring-webflow jar吗?
-
是的。在这个阶段,我在 WAR 的类路径中拥有大部分 Spring JAR 文件。因此,JAR 嵌入到 WAR 中,而 WAR 本身也嵌入到 EAR 中。 (抱歉回复晚了,我身体不好)。
标签: spring spring-mvc oc4j