Skip to content

Conversation

@thomasrebele
Copy link
Contributor

What changes were proposed in this pull request?

Ignore NoClassDefFoundError in addition to the already ignored ClassNotFoundException.

Why are the changes needed?

A NoClassDefFoundError is sometimes thrown when debugging tests in Intellij IDEA.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manually while debugging a qfile test with Intellij IDEA.

@sonarqubecloud
Copy link

@deniskuzZ
Copy link
Member

@thomasrebele, could you please attach the stacktrace

@thomasrebele
Copy link
Contributor Author

Unfortunately I've forgot to save the stacktrace, and I've also forgot which test caused the problem. If I encounter it again, I'll add the stacktrace. It happened at least twice in the last three months, so it's quite likely to happen again.

system.registerGenericUDF("iceberg_zorder",
(Class<? extends GenericUDF>) Class.forName("org.apache.iceberg.mr.hive.udf.GenericUDFIcebergZorder"));
} catch (ClassNotFoundException e) {
} catch (ClassNotFoundException | NoClassDefFoundError e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, we should not try to catch instances of Error in application code. Moreover, the Javadoc of NoClassDefFoundError writes the following:

 * The searched-for class definition existed when the currently
 * executing class was compiled, but the definition can no longer be
 * found.

If we get this exception then it seems more like an IDE config issue rather than something that we need to fix here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants