If StackOverflowError causes NoClassDefFoundError, the original SOE is swallowed and isn't reported in the stack trace.
The issue happens in specific circumstances, when the class initialization procedure detects an error in class instantiation, tries to throw NCDFE with a correctly discovered cause (an original SOE), and catches another SOE when it tries to get the cause.
The reproducer is attached as jtreg test to the proposed fix.
Testing shows that the issue exists in versions 11, 13, 17, and 19.