Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EmailService not working due to unsatisfied reference to MailTemplateManager in AEM on prem #3471

Open
3 tasks
bbruns1926 opened this issue Nov 13, 2024 · 11 comments · May be fixed by #3490
Open
3 tasks

EmailService not working due to unsatisfied reference to MailTemplateManager in AEM on prem #3471

bbruns1926 opened this issue Nov 13, 2024 · 11 comments · May be fixed by #3490
Labels
Milestone

Comments

@bbruns1926
Copy link

Required Information

  • AEM Version, including Service Packs, Cumulative Fix Packs, etc: 6.5.21
  • ACS AEM Commons Version: 6.9.0+
  • Reproducible on Latest? yes

Expected Behavior

ACS Commons EmailService works in AEM on prem.

Actual Behavior

With #3422 (ACS Commons 6.9.0) MailTemplateManager was introduced and added as a reference to EmailService and the implementation for the MailTemplateManager was placed in bundle-cloud and bundle-onprem. Unfortunately the bundle-onprem is missing in acs-aem-commons-all-6.9.*.zip files. Looks like the dependency entry for bundle-onprem is missing in all/pom.xml.
I did a quick try and after adding the dependency to all/pom.xml bundle-onprem was part of the resulting zip file but the build failed with:
[ERROR] [artifact-rules] com.adobe.acs:acs-aem-commons-bundle-onprem:6.9.5-SNAPSHOT: The Adobe ACS Commons onprem bundle is not supported (adobe/consulting:acs-aem-commons-all:6.9.5-SNAPSHOT)

In addition to the missing bundle in the zip file it looks like something with the implementation is not working. I manually installed a locally build acs-aem-commons-bundle-onprem:6.9.4 but then the following error occurred:
java.lang.ClassNotFoundException: com.adobe.acs.commons.email.impl.MailTemplateManager not found by acs-aem-commons-bundle-onprem

Steps to Reproduce

For the first part of the issue AEM is not needed to reproduce this. Just open acs-aem-commons-all-6.9.*.zip and go to jcr_root\apps\acs-commons\install. There only acs-aem-commons-bundle is present and acs-aem-commons-bundle-onprem is missing.
With AEM navigate to http://localhost:4502/system/console/components and search for com.adobe.acs.commons.email.impl.EmailServiceImpl. The status will be "unsatisfied (reference)"

For the second part navigate to http://localhost:4502/system/console/components and search for com.adobe.acs.commons.email.impl.MailTemplateManagerImpl. The status will be "satisfied" and in the error.log of AEM there will be messages like:
java.lang.ClassNotFoundException: com.adobe.acs.commons.email.impl.MailTemplateManager not found by acs-aem-commons-bundle-onprem

@Roman-Skripka
Copy link

We encountered the same problem. Additionally interface com.adobe.acs.commons.email.impl.MailTemplateManager is in wrong package. This makes the latest releases unusable for on-prem. @kwin please pay attention.

@davidjgonzalez
Copy link
Contributor

davidjgonzalez commented Dec 5, 2024

@cziegeler do you know what's going on w/ this?
I assume the MailTemplateManager interface should be in a public package? (not in com.adobe.acs.commons.email.impl ?)

Thanks!

@davidjgonzalez
Copy link
Contributor

davidjgonzalez commented Dec 5, 2024

I think this should fix it: #3488 -- any chance you can try it out @Roman-Skripka ?

acs-aem-commons-all-6.9.7-SNAPSHOT.zip

@davidjgonzalez davidjgonzalez added this to the 6.9.8 milestone Dec 5, 2024
@cziegeler
Copy link
Contributor

It should not be required that the api is in a public package for as long as the on prem bundle is a fragment bundle. Either my understanding of a fragment bundle is wrong or there is something else.
Does it also not work in cloud service?
It is not the end of the world if that api needs to be made public, but it would be nice if we can avoid it.

@cziegeler cziegeler mentioned this issue Dec 5, 2024
@cziegeler
Copy link
Contributor

I don't see the Fragment-Host header in the bundles anymore; that might already be the problem

@cziegeler
Copy link
Contributor

The bnd configuration in the pom for the maven bundle plugin is complete ignored. I think this worked when I made the PR.
So this seems to be a tooling problem

@cziegeler
Copy link
Contributor

The problem is that the parent pom has already a bnd configuration , therefore configurations further down are ignored

@kwin
Copy link
Contributor

kwin commented Dec 5, 2024

I am pretty sure this once used to work: https://github.com/bndtools/bnd/blob/master/maven-plugins/bnd-maven-plugin/README.md#bnd-instruction-inheritance. The same approach is used inside https://github.com/adobe/asset-share-commons/blob/d574785ccca2d955878711b48029db7070fcf1af/core.cloud/pom.xml#L46-L50. However I can also see that this configuration is now completely disregarded...

Something in here https://github.com/bndtools/bnd/blob/f9b2c857859dd3e46401f2f19aba4b09f308a16e/biz.aQute.bnd.maven/src/aQute/bnd/maven/lib/configuration/BndConfiguration.java#L39 does no longer seem to work correctly... Maybe it depends on the Maven version. With 3.9.9 it does no longer work!

@Roman-Skripka
Copy link

@davidjgonzalez yes, provided package fixes the problem, also I can see the on-prem bundle being present.

@kwin
Copy link
Contributor

kwin commented Dec 5, 2024

@cziegeler @davidjgonzalez Seems to be an issue with how the bnd-maven-plugin deals with Maven configurations: bndtools/bnd#6390. A combination of execution configuration on parent level and global configuration on bundle module's levels is not treated correctly by bnd-maven-plugin.

kwin added a commit that referenced this issue Dec 5, 2024
Previously the configuration from the parent (per execution id) was
overriding the local config (per plugin). Now the parent configuration
is no longer per execution id, i.e. both local plugin configurations
(i.e. on plugin level and on execution id level) take precedence.

This closes #3471
@kwin kwin linked a pull request Dec 5, 2024 that will close this issue
@cziegeler
Copy link
Contributor

👍

@davidjgonzalez davidjgonzalez modified the milestones: 6.9.8, 6.10.2 Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants