InstallHooks get loaded through the DynamicClassLoader in the Package Manager. That is a problem, because the DynamicClassLoader is throwing a ClassNotFoundException in case the DynamicClassLoaderManager was unregistered in the meantime. That might happen if a bundle got updated by the Package Manager which in the past provided at least one class which was loaded through any of the DynamicClassLoaders.
Especially if you have a big package containing a lot of subpackages which itself contain bundles, the DynamicClassLoaderManager might get unregistered and reregistered several times during the time the package manager is doing its job. If at the time when a subpackage is installed the DynamicClassLoaderManager is still unregistered, that classloader being used to load the InstallHook is not able to load any class. How can I workaround that limitation, except with integrating the whole InstallHook into my package (so that the UrlClassLoader is used)?