You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2015/07/08 18:14:04 UTC
[jira] [Updated] (GROOVY-3356) Groovy incompatible with 3rd party
XML DOM parsers
[ https://issues.apache.org/jira/browse/GROOVY-3356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pascal Schumacher updated GROOVY-3356:
--------------------------------------
Affects Version/s: 2.4.3
> Groovy incompatible with 3rd party XML DOM parsers
> --------------------------------------------------
>
> Key: GROOVY-3356
> URL: https://issues.apache.org/jira/browse/GROOVY-3356
> Project: Groovy
> Issue Type: Bug
> Components: groovy-jdk, XML Processing
> Affects Versions: 1.6-rc-3, 2.4.3
> Environment: Groovy 1.6.0 RC3, Java 1.6.0_10
> Reporter: John Hurst
> Priority: Minor
>
> With Groovy versions 1.5.7 onwards there is a problem where Groovy loads
> DOM classes from the Java SDK in its RootLoader constructor.
> This makes it incompatible with XML parsing libraries having different
> versions of DOM interfaces. For example, with Oracle XML Parser I get:
> Caught: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/w3c/dom/NamedNodeMap"
> $groovy -e "println javax.xml.parsers.DocumentBuilderFactory.newInstance().getClass()"
> class oracle.xml.jaxp.JXDocumentBuilderFactory
> $jar tvf ~/.groovy/lib/xmlparserv2-10.2.0.2.0.jar |grep "org/w3c/dom/NamedNodeMap"
> 581 Tue Dec 23 12:53:38 NZDT 2003 org/w3c/dom/NamedNodeMap.class
> $jar tvf $JAVA_HOME/jre/lib/rt.jar |grep "org/w3c/dom/NamedNodeMap"
> 566 Fri Sep 26 01:22:26 NZST 2008 org/w3c/dom/NamedNodeMap.class
> This is caused by change r12189, comment:
> adds a special hack for org.w3c.dom.Node, to avoid violation of class loader constraints
> The troublesome lines are:
> // major hack here...!
> try{
> customClasses.put("org.w3c.dom.Node",super.loadClass("org.w3c.dom.Node",false));
> } catch (Exception e) {}
> If I undo this change in trunk, I get a version of Groovy which works happily
> with the Oracle XML Parser.
> For what it's worth, I need to use the Oracle XML Parser because it contains
> code required by the Oracle XDK, required to use Oracle XML functionality in
> the JDBC driver.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)