Skip to content

Handle NoClassDefFoundError in Dyn* classes #3644

Description

@nastra

Describe the bug, including details regarding any error messages, version, and platform.

All of the Dyn* classes use Class.forName(className, true, loader) and catch ClassNotFoundException when probing for optional implementations by class name, but Class.forName can also throw NoClassDefFoundError when the class itself is found but one of its transitive dependencies is missing. It can also throw ExceptionInInitializerError when the static initializer of the loaded class fails.
We're intentionally not handling ExceptionInInitializerError and propagate it to the caller.

DynConstructors already handles ClassNotFoundException and NoClassDefFoundError while DynMethods only handles ClassNotFoundException

This issue is similar to apache/iceberg#16793 and apache/iceberg#16611 that we're fixing on the Iceberg side.

Component(s)

Core

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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