OSGiPackageScanClassResolver doesn't catch NoClassDefFoundErrors

Description

The liquibase.osgi.OSGiPackageScanClassResolver is used in OSGi to resolve/load classes via bundle wiring.
In l.39 ff., it catches the case where bundleClassLoader.loadClass(...) throws a ClassNotFoundException.
But there are classes that have static dependencies to non-resolvable other classes, like LiquibaseEntityResolver (which needs org.xml.sax stuff). When trying to load such a class, there will be a NoClassDefFoundError (not a ClassNotFoundException). When the OSGiPackageScanClassResolver stumbles over such a class, the current package isn't scanned further, because this Throwable is not catched.
I propose to catch any Throwable instead of ClassNotFoundException, so that the resolver can work correctly.

Environment

OSGi

Reporter

Andreas Lemmer

Components

Affects versions

Priority

Blocker
Configure