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
Describe the bug, including details regarding any error messages, version, and platform.
All of the
Dyn*classes useClass.forName(className, true, loader)and catchClassNotFoundExceptionwhen probing for optional implementations by class name, butClass.forNamecan also throwNoClassDefFoundErrorwhen the class itself is found but one of its transitive dependencies is missing. It can also throwExceptionInInitializerErrorwhen the static initializer of the loaded class fails.We're intentionally not handling
ExceptionInInitializerErrorand propagate it to the caller.DynConstructorsalready handlesClassNotFoundExceptionandNoClassDefFoundErrorwhileDynMethodsonly handlesClassNotFoundExceptionThis issue is similar to apache/iceberg#16793 and apache/iceberg#16611 that we're fixing on the Iceberg side.
Component(s)
Core