Skip to content

Common: Handle NoClassDefFoundError during optional Dyn* class loading#16793

Open
nastra wants to merge 1 commit into
apache:mainfrom
nastra:dyn-classes-noclassdeffound
Open

Common: Handle NoClassDefFoundError during optional Dyn* class loading#16793
nastra wants to merge 1 commit into
apache:mainfrom
nastra:dyn-classes-noclassdeffound

Conversation

@nastra

@nastra nastra commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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.

The PR was created with the help of Claude Code

@nastra nastra force-pushed the dyn-classes-noclassdeffound branch 3 times, most recently from 567cf39 to 919b79e Compare June 12, 2026 14:05
@nastra nastra requested a review from rdblue June 12, 2026 14:07
Comment thread common/src/main/java/org/apache/iceberg/common/DynClasses.java
Comment thread common/src/main/java/org/apache/iceberg/common/DynConstructors.java
@nastra nastra force-pushed the dyn-classes-noclassdeffound branch from 919b79e to 6579a0a Compare June 13, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants