how to fix this code scanner report issue in AEMaaCS | Community
Skip to main content
Level 4
June 13, 2023
Solved

how to fix this code scanner report issue in AEMaaCS

  • June 13, 2023
  • 2 replies
  • 868 views

The product interface org.apache.sling.api.resource.Resource annotated with @ProviderType should not be implemented by custom code. Detected in com.day.cq.wcm.api.TemplatedResource contained in /apps/aem-app-packages/application/install/core-aemapp.core-1.0.0-SNAPSHOT.jar.

 

The product interface com.day.cq.wcm.api.Page annotated with @ProviderType should not be implemented by custom code. Detected in com.day.cq.wcm.api.msm.Blueprint contained in /apps/aem-app-packages/application/install/core-aemapp.core-1.0.0-SNAPSHOT.jar.

Rule:

CQRules:CQBP-84

https://www.adobe.com/go/aem_cmcq_cqbp-84_en

 

i don't have any custom code which implement Resource but still i'm getting this issue reported.

 

Does anyone know that how to fix it?  

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 MayurSatav

Hi @karthickve ,

 

Even if you don't have any explicit custom code implementing these interfaces, the issue could be caused by third-party libraries or dependencies included in your project.

 

Use tools like the Apache Sling Feature Model Analyzer (https://github.com/apache/sling-org-apache-sling-feature-analyser) or other dependency analysis tools to identify which packages are causing the issue. This can help you pinpoint the source of the problem and take appropriate action. Also review AEM versions and compatibility.

 

2 replies

MayurSatav
Community Advisor and Adobe Champion
MayurSatavCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 13, 2023

Hi @karthickve ,

 

Even if you don't have any explicit custom code implementing these interfaces, the issue could be caused by third-party libraries or dependencies included in your project.

 

Use tools like the Apache Sling Feature Model Analyzer (https://github.com/apache/sling-org-apache-sling-feature-analyser) or other dependency analysis tools to identify which packages are causing the issue. This can help you pinpoint the source of the problem and take appropriate action. Also review AEM versions and compatibility.

 

ManviSharma
Adobe Employee
Adobe Employee
June 14, 2023

Hi,

 

This issue occurs when interfaces like org.apache.sling.api.resource.Resource and com.day.cq.wcm.api.Page annotated with @ProviderType are implemented by custom code, which is not recommended. To fix the problem:

  1. Check if there is any custom code present in the mentioned JAR file.
  2. Verify if any third-party dependencies in the JAR file implement these interfaces.