You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/12/17 16:55:00 UTC
[jira] [Commented] (HADOOP-17540) hadoop-client-runtime-3.3.0 not properly shading javax.xml.bind
[ https://issues.apache.org/jira/browse/HADOOP-17540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18045928#comment-18045928 ]
ASF GitHub Bot commented on HADOOP-17540:
-----------------------------------------
friscoMad opened a new pull request, #8139:
URL: https://github.com/apache/hadoop/pull/8139
### Description of PR
This file breaks using jaxb in the same classpath where Hadoop is present if JVM 9+ See ticket: https://issues.apache.org/jira/browse/HADOOP-17540
This was fixed on https://github.com/apache/hadoop/pull/7019 for trunk, but the 3.4 branch still has the problem, I am not sure if you are planning to cut a new release from 3.4 but as I see that there has been commits in that branch I assume that it will happen eventually.
In fact, we would love a 3.3 backport, as I am not sure if Spark 3 will work with Hadoop 3.4 which is our setup.
### How was this patch tested?
I have not tested it as I don't have the setup for this project done.
But it should be as simple as generating the shaded jars, expanding, and confirming that the file is not there anymore.
### For code changes:
- [X] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files?
> hadoop-client-runtime-3.3.0 not properly shading javax.xml.bind
> ---------------------------------------------------------------
>
> Key: HADOOP-17540
> URL: https://issues.apache.org/jira/browse/HADOOP-17540
> Project: Hadoop Common
> Issue Type: Bug
> Components: hdfs-client
> Affects Versions: 3.3.0
> Reporter: Lorie
> Priority: Major
>
> In the file hadoop-client-modules/hadoop-client-runtime/pom.xml, it excludes javax.xml.bind because it says it is part of the SE JDK. But, this is no longer true in Java 11.
>
> |<exclusions>|
> | |<!-- these APIs are a part of the SE JDK -->|
> | |<exclusion>|
> | |<groupId>javax.xml.bind</groupId>|
> | |<artifactId>jaxb-api</artifactId>|
> | |</exclusion>|
>
> So, when I try to use Guice to inject objects at start up, I am getting the error
> Error injecting constructor, java.lang.NoClassDefFoundError: org/apache/hadoop/shaded/javax/xmlbind/ModuleUtil (wrong name: javax/xml/bind/ModuleUtil)
>
> I was able to get past this by using zip to change the position of the ModuleUtil.class inside the META-INF directory.
> Before I made any changes:
> jar tvf hadoop-client-runtime-3.3.0.jar | grep ModuleUtil*
> META-INF/versions/9/javax/xml/bind/ModuleUtil.class
> org/apache/hadoop/shaded/javax/xml/bind/ModuleUtil.class
> After I modified the jar:
> jar tvf hadoop-client-runtime-3.3.0-MODIFIED.jar | grep ModuleUtil*
> META-INF/versions/9/org/apache/hadoop/shaded/javax/xml/bind/ModuleUtil.class
> org/apache/hadoop/shaded/javax/xml/bind/ModuleUtil.class
> With the revised jar file, my code started. I don't know if that is the correct way to fix but it works.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org