Skip to content

[Common] Fix ClassLoaderUtils dynamic classpath on JDK 9+ #4398

Description

@shangeyao

Problem

On JDK 9+, the system class loader is not a URLClassLoader and the ucp field lives on a superclass. ClassLoaderUtils.addURL throws NoSuchFieldException: ucp, breaking Hadoop conf directory loading.

Proposed solution

  • Try TCCL and system class loader in order
  • Walk the class hierarchy to locate ucp on JDK 9+ built-in loaders
  • Keep URLClassLoader.addURL path for older JDKs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions