I have a web application where i am using spring 3.0 and oracle's XMLTYPE related jar's com.oracle.xdb which in turn depends on com.oracle.xml.xmlparserv2 , iam sure most of you aware of the exception that you get when these jars are used with spring 3.0 as below,
Caused by: oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'
there are some suggestions to use a different parser like xerces, but in our case since we use the xdb dependency, it looks like we cannot change it to use another parser other than com.oracle.xml.xmlparserv2, it was working fine with spring 2.5.6 is there any info on when this would be fixed either by spring/oracle?
Instead of modifying xmlparserv2.jar
you can add
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
Click here to read a post on Oracle's forums talking about the issue.
I have identified that the problem is due to the inhability of xmlparserv2 to appropriately parse the xsi:schemaLocation
attribute.
I have checked that this works:
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
While this produces the eror:
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"
The workaround is to remove the use of specific namespaces (such as tx, util..) and replace them by the equivalent definitions using common beans. For example, you can replace <tx:annotation-driven/>
with <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With