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

NPE at ReferencesModel #3357

Open
3 tasks
alexanderigeorgiev opened this issue Jun 6, 2024 · 1 comment
Open
3 tasks

NPE at ReferencesModel #3357

alexanderigeorgiev opened this issue Jun 6, 2024 · 1 comment
Labels

Comments

@alexanderigeorgiev
Copy link

alexanderigeorgiev commented Jun 6, 2024

Required Information

  • AEM Version, including Service Packs, Cumulative Fix Packs, etc: AEMaaCS 2024.4.15860.20240410T113939Z
  • ACS AEM Commons Version: 6.3.2
  • Reproducible on Latest? no

We get a NPE at com.adobe.acs.commons.reports.models.ReferencesModel.init(ReferencesModel.java:89) when trying to download a report (Tools->ACS Commons-> Reports) on our prod environment. Since this is AEM as Cloud Service, we can not investigate the actual reason behind this.

So please add some null checks and some log, so that the functionality does not break and we have some useful log for further investigation.

Expected Behavior

When we run an ACS Commons Report that provides some result, we want to download the result as excel file. And the excel file should hold the same data as the one shown in the result table.

Actual Behavior

On our production environment, the Download Report button provides incorrect file, without any result data into it.
In the error log file we found this:

05.06.2024 07:28:27.663 [cm-p16016-e53953-aem-author-84c7659756-rvw9d] *WARN* [147.161.254.88 [1717572507294] GET /var/acs-commons/reports/aem-3160-reference-to-prodcut-catalog/_jcr_content.results.html HTTP/1.1] com.adobe.cq.xf.impl.reference.PageToXfReferenceProvider The resource at /content/brands/bbraun/be/website-6/fr/solutions-et-produits/therapies/sutures-et-specialites-chirurgicales/fermeture-des-plaies/sutures-non-resorbables/jcr:content/root/container/container/productteaser/products/2 doesn't point to a page
05.06.2024 07:28:27.663 [cm-p16016-e53953-aem-author-84c7659756-rvw9d] *WARN* [147.161.254.88 [1717572507294] GET /var/acs-commons/reports/aem-3160-reference-to-prodcut-catalog/_jcr_content.results.html HTTP/1.1] com.adobe.cq.xf.impl.reference.XfToXfReferenceProvider The resource at /content/brands/bbraun/be/website-6/fr/solutions-et-produits/therapies/sutures-et-specialites-chirurgicales/fermeture-des-plaies/sutures-non-resorbables/jcr:content/root/container/container/productteaser/products/2 doesn't point to a page
05.06.2024 07:28:28.017 [cm-p16016-e53953-aem-author-84c7659756-rvw9d] *WARN* [147.161.254.88 [1717572507294] GET /var/acs-commons/reports/aem-3160-reference-to-prodcut-catalog/_jcr_content.results.html HTTP/1.1] org.apache.sling.models.impl.ModelAdapterFactory Could not adapt to model
java.lang.NullPointerException: null
	at com.adobe.acs.commons.reports.models.ReferencesModel.init(ReferencesModel.java:89)
	at jdk.internal.reflect.GeneratedMethodAccessor857.invoke(Unknown Source)

The same content and report are working on our stage environment and on local environment.
The warning about resource that does not point to a page are present on stage/local, but the NPE is not.

Steps to Reproduce

The problem could not be reproduced on another instance

This is the JCR-SQL2 query that we execute:

SELECT * FROM [nt:unstructured] AS s WHERE ISDESCENDANTNODE(s, "{{{home}}}") AND CONTAINS(s.*, '"{{{path}}}"')

davidjgonzalez added a commit to davidjgonzalez/acs-aem-commons that referenced this issue Jun 27, 2024
@davidjgonzalez
Copy link
Contributor

This should help w/ debugging: #3372

davidjgonzalez added a commit that referenced this issue Aug 14, 2024
…n… (#3372)

* #3357 - Added debugging and nullchecking to ReferencesModel to prevent NPEs
YegorKozlov pushed a commit to YegorKozlov/acs-aem-commons that referenced this issue Aug 15, 2024
… ReferencesModel to preven… (Adobe-Consulting-Services#3372)

* Adobe-Consulting-Services#3357 - Added debugging and nullchecking to ReferencesModel to prevent NPEs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants