Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

AEMasCS Sonar Error unable run class- null pointer

Avatar

Level 5

I was trying to build the custom code in Cloud Service Environment getting below trace and unable to run sonar checks. 

 

Let me know if anyone had similar issue and any solutions helped?

 

Error Trace-

Unable to run check class com.adobe.platform.experience.selfservice.cqrules.checks.java.UnableToSupportSlingSchedulerCheck - AMSCORE-554 on file /build_root/build/****/core/src/main/java/***************.java, To help improve SonarJava, please report this problem to SonarSource : see https://www.sonarqube.org/community/

java.lang.NullPointerException: null
at com.adobe.platform.experience.selfservice.cqrules.checks.java.UnableToSupportSlingSchedulerCheck.getClassFullyQualifierName(UnableToSupportSlingSchedulerCheck.java:82)
at com.adobe.platform.experience.selfservice.cqrules.checks.java.UnableToSupportSlingSchedulerCheck.visitNode(UnableToSupportSlingSchedulerCheck.java:67)

1 Accepted Solution

Avatar

Correct answer by
Level 5

@agubrani  yea I was able to figure out issue. Removed few java class causing issues and checked build it worked you can also try to figure out what the actual issue.

 

Our code based had Sling Commons Scheduler and other external API so had to upgrade it to sling job

View solution in original post

5 Replies

Avatar

Employee Advisor

Hi @manjunathdj ,

 

Check if you are using Sling Commons Scheduler in your codebase, it looks related to it.

The use of Sling Commons Scheduler is not supported by AEM as a Cloud Service because it cannot guarantee to process when AEM environments are recreated, you could use Sling Jobs instead.

https://blog.developer.adobe.com/handling-sling-schedulers-in-aem-as-a-cloud-service-cb59d5e59e9 

 

Documentation for Sling jobs:-

https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html#jobs-guar... 

 

If that's not the case, open a support ticket so that team can take a deeper look if it's a false positive.

 

Hope this helps!

 

Regards,

Nitesh

Avatar

Level 5

@nitesh_kumar  - Thanks for your reply I'm not using Sling Commons Scheduler in code but code is using 3rd party biweekly API let me open adobe ticket to have deeper look.

 

Avatar

Level 1

Hi @manjunathdj,

 

Did you find out what was causing this? I am also getting similar issues with my build.

 

Thanks,

Ankit

Avatar

Correct answer by
Level 5

@agubrani  yea I was able to figure out issue. Removed few java class causing issues and checked build it worked you can also try to figure out what the actual issue.

 

Our code based had Sling Commons Scheduler and other external API so had to upgrade it to sling job