valtech / aem-easy-content-upgrade

AEM Easy Content Upgrade simplifies content migrations in AEM projects
Other
61 stars 27 forks source link

Aecu Install Hook throws NPE #155

Closed B3r closed 3 years ago

B3r commented 3 years ago

Hey there, after raising our plugin versions, we are currently trying to get the Install Hook running with content-package-maven-plugin v1.0.4 and filevault-package-maven-plugin v1.1.6

c-p-m-p doesnt support properties in configuration any longer. AFAIK, it will only do the deployment job. f-p-m-p however is supporting those. So we used the filevault plugin for the install hook.

Doing so however results in a NPE (not necessarily due to using the filevault plugin):

AECU Version 2.0.0 Java 11 AEM 6.5.7 Groovy Console 13

04.05.2021 08:41:47.567 *WARN* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl Hook aecu threw runtime exception.
java.lang.NullPointerException: null
    at de.valtech.aecu.core.installhook.AecuTrackerListener.onMessage(AecuTrackerListener.java:80)
    at de.valtech.aecu.core.installhook.AecuTrackerListener.logMessage(AecuTrackerListener.java:131)
    at de.valtech.aecu.core.installhook.AecuTrackerListener.<init>(AecuTrackerListener.java:64)
    at de.valtech.aecu.core.installhook.AecuInstallHook.execute(AecuInstallHook.java:91)
    at org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl.execute(InstallHookProcessorImpl.java:149)
    at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:227)
    at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.extract(JcrPackageImpl.java:401)
    at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.extract(JcrPackageImpl.java:360)
    at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.install(JcrPackageImpl.java:354)
    at com.adobe.granite.installer.factory.packages.impl.PackageTransformer$InstallPackageTask.execute(PackageTransformer.java:348)
    at org.apache.sling.installer.core.impl.OsgiInstallerImpl.doExecuteTasks(OsgiInstallerImpl.java:914)
    at org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.java:749)
    at org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:298)
    at java.base/java.lang.Thread.run(Thread.java:834)
04.05.2021 08:41:47.669 *WARN* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl Hook aecu threw runtime exception.
java.lang.NullPointerException: null
    at de.valtech.aecu.core.installhook.AecuInstallHook.getScriptsForExecution(AecuInstallHook.java:121)
    at de.valtech.aecu.core.installhook.AecuInstallHook.execute(AecuInstallHook.java:99)
    at org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl.execute(InstallHookProcessorImpl.java:149)
    at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:241)
    at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.extract(JcrPackageImpl.java:401)
    at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.extract(JcrPackageImpl.java:360)
    at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.install(JcrPackageImpl.java:354)
    at com.adobe.granite.installer.factory.packages.impl.PackageTransformer$InstallPackageTask.execute(PackageTransformer.java:348)
    at org.apache.sling.installer.core.impl.OsgiInstallerImpl.doExecuteTasks(OsgiInstallerImpl.java:914)
    at org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.java:749)
    at org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:298)
    at java.base/java.lang.Thread.run(Thread.java:834)
gruberrolandvaltech commented 3 years ago

Do you get the same with AECU 4.0.0?

B3r commented 3 years ago

Hey, just checked with AECU 4.0.0, still no success, same error

gruberrolandvaltech commented 3 years ago

I updated AECU to the above versions and all is running fine. Looks like this is more an issue with your package. Can you provide the output when you have AECU 4.0.0 running? Maybe I can find something then by inspecting the code.

myslinskipawel commented 3 years ago
07.06.2021 16:29:55.924 *WARN* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl Hook aecu threw runtime exception.
java.lang.NullPointerException: null
    at de.valtech.aecu.core.installhook.AecuTrackerListener.onMessage(AecuTrackerListener.java:80)
    at de.valtech.aecu.core.installhook.AecuTrackerListener.logMessage(AecuTrackerListener.java:131)
    at de.valtech.aecu.core.installhook.AecuTrackerListener.<init>(AecuTrackerListener.java:64)
    at de.valtech.aecu.core.installhook.AecuInstallHook.execute(AecuInstallHook.java:91)
    at org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl.execute(InstallHookProcessorImpl.java:149)
    ...
07.06.2021 16:29:56.062 *WARN* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl Hook aecu threw runtime exception.
java.lang.NullPointerException: null
    at de.valtech.aecu.core.installhook.AecuInstallHook.getScriptsForExecution(AecuInstallHook.java:121)
    at de.valtech.aecu.core.installhook.AecuInstallHook.execute(AecuInstallHook.java:99)
    at org.apache.jackrabbit.vault.packaging.impl.InstallHookProcessorImpl.execute(InstallHookProcessorImpl.java:149)
    ...

https://github.com/valtech/aem-easy-content-upgrade/blob/4.0.0/core/src/main/java/de/valtech/aecu/core/installhook/AecuInstallHook.java Looks like AECu expects this to be not null but it is : org.apache.jackrabbit.vault.packaging.InstallContext.getOptions().getListener() ProgressTrackerListener originalListener = installContext.getOptions().getListener();

Important hint: it happens only when installing 'all' package - pom.xml similar to default one https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/all/pom.xml Installing ui.config package separately works fine

myslinskipawel commented 3 years ago

@gruberrolandvaltech it's solved. We adjusted filevault-package-maven-plugin configuration to use subpackages (like in your bundle project) instead of embedding packages which is used by Adobe.

gruberrolandvaltech commented 3 years ago

Thanks a lot for the feedback. I put a hint in readme.