InstallHook gets loaded through DynamicClassLoader (which might get invalid during package installation) | Community
Skip to main content
Level 2
October 16, 2015
Solved

InstallHook gets loaded through DynamicClassLoader (which might get invalid during package installation)

  • October 16, 2015
  • 1 reply
  • 1057 views

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)?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

there were 2 version of install hook and was causing some installation issue.  Right way is to use jackrabbit API for hooks.    Can you please file support request mentioning

-   AEM version

-    Exact log files.

-    Sample package and steps to reproduce the issue.

1 reply

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

there were 2 version of install hook and was causing some installation issue.  Right way is to use jackrabbit API for hooks.    Can you please file support request mentioning

-   AEM version

-    Exact log files.

-    Sample package and steps to reproduce the issue.