重复定义:'identifiedType'

Ara*_*ias 14 xml oracle spring types jar

我有一个Web应用程序,我使用的是Spring 3.0和oracle的XMLTYPE相关jar的com.oracle.xdb,后者依赖于com.oracle.xml.xmlparserv2,我相信你们大多数人都知道这些罐子是你得到的异常.与弹簧3.0一起使用如下,

引起:oracle.xml.parser.schema.XSDException:重复定义:'identifiedType'

有一些建议使用像xerces这样的不同解析器,但在我们的例子中,因为我们使用xdb依赖项,看起来我们无法将其更改为使用除com.oracle.xml.xmlparserv2之外的另一个解析器,它在春天工作正常2.5.6是否有关于何时由spring/oracle修复的信息?

Sha*_*ane 13

而不是修改xmlparserv2.jar你可以添加

-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl

点击此处阅读Oracle论坛上关于该问题的帖子.


Pau*_*ner 5

我已经确定问题是由于xmlparserv2的吸入能够适当地解析xsi:schemaLocation属性.

我已经检查过这是否有效:

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
Run Code Online (Sandbox Code Playgroud)

虽然这会产生错误:

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
Run Code Online (Sandbox Code Playgroud)

解决方法是删除特定命名空间(例如tx,util ..)的使用,并使用公共bean通过等效定义替换它们.例如,您可以替换<tx:annotation-driven/><bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>


小智 5

从xmlparserv2.jar中删除/ META-INF/services目录 - 它的内容注册了Oracle的解析器.