[
https://issues.apache.org/jira/browse/TIKA-4130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17767620#comment-17767620
]
Tim Allison commented on TIKA-4130:
-----------------------------------
I worry about the effects of making this change.
If we exclude those classes, are they being supplied by Java 8, 11, 17 and now
21?
Is our bundling of xerces causing this problem?
We're considering removing the xerces dependency in Tika 3.x which will require
Java 11 (TIKA-4135). Would that solve your problem?
> Conflict with duplicate org/w3c and org/xml packages in tika-app jar
> --------------------------------------------------------------------
>
> Key: TIKA-4130
> URL: https://issues.apache.org/jira/browse/TIKA-4130
> Project: Tika
> Issue Type: Improvement
> Affects Versions: 2.7.0
> Environment: Java 8 and Java 11
> Reporter: RaahulUmapathy
> Priority: Major
>
> While attempting to migrate from version 1.20 to version 2.7 of Apache Tika,
> I encountered a specific error.
> We have been using a "child-first classloader" to isolate the tika-app JAR
> from the classpath for file parsing.
> {+}The error message we're facing is as follows{+}:
> java.lang.LinkageError: loader constraint violation: when resolving
> overridden method
> "org.apache.xerces.jaxp.DocumentBuilderImpl.newDocument()Lorg/w3c/dom/Document;"
> the class loader (instance of org/xeustechnologies/jcl/JarClassLoader) of
> the current class, org/apache/xerces/jaxp/DocumentBuilderImpl, and its
> superclass loader (instance of <bootloader>), have different Class objects
> for the type org/w3c/dom/Document used in the signature.
> Upon analysis, I can see that a conflict exists between the default
> classloader (rt.jar) and our child-first classloader due to different
> versions of the class "Node.class" (org/w3c package) in both jars. Similar
> issues were encountered with the classes in "org/xml" package too.
> {+}The parsing functionality worked correctly after removing the following
> packages from the tika-app JAR{+}:
> 1. org/w3c/**
> 2. org/xml/**
> We are currently using Java 8 and would greatly appreciate guidance on the
> same.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)