You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "anoopj (via GitHub)" <gi...@apache.org> on 2026/05/29 15:09:28 UTC

Re: [PR] Common, Core: Handle ExceptionInInitializerError & NoClassDefFoundError during optional Dyn* class loading [iceberg]

anoopj commented on code in PR #16611:
URL: https://github.com/apache/iceberg/pull/16611#discussion_r3325191085


##########
common/src/main/java/org/apache/iceberg/common/DynClasses.java:
##########
@@ -66,7 +66,7 @@ public Builder impl(String className) {
 
       try {
         this.foundClass = Class.forName(className, true, loader);
-      } catch (ClassNotFoundException e) {
+      } catch (ClassNotFoundException | NoClassDefFoundError | ExceptionInInitializerError e) {
         // not the right implementation

Review Comment:
   ```suggestion
           // cannot load this implementation
   ```



##########
core/src/main/java/org/apache/iceberg/formats/FormatModelRegistry.java:
##########


Review Comment:
   ExceptionInInitializerError.getMessage() would return null. One way to fix it is to check if `e.getCause()` is not null and if so use its message. 



##########
common/src/main/java/org/apache/iceberg/common/DynConstructors.java:
##########
@@ -144,7 +144,7 @@ public Builder impl(String className, Class<?>... types) {
       try {
         Class<?> targetClass = classForName(className);
         impl(targetClass, types);
-      } catch (NoClassDefFoundError | ClassNotFoundException e) {
+      } catch (NoClassDefFoundError | ClassNotFoundException | ExceptionInInitializerError e) {
         // cannot load this implementation

Review Comment:
   comment is stale (same fix as above). Same applies for below



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org