Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-17540

hadoop-client-runtime-3.3.0 not properly shading javax.xml.bind

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.3.0
    • None
    • hdfs-client
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Lorie Lorie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: