Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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.