Expand my Community achievements bar.

NullPointerException while sending workflow notification emails

Avatar

Level 4

Hello all! The community has been very helpful with past issues, so I figured I'd bring this one here as well - Perhaps you'll all have some ideas.

 

I've seen a lot of people with EMailNotificationService or various other workflow-email-related issues that are typically configuration errors resolved by adjusting the configs... however all of our configurations on the problem instance are cloned from an instance where email notifications are working. That said, I don't believe this is a configuration issue like the others that I've seen. The error is produced from an internal CQ jar that I can't seem to find documented.

 

Steps to produce:

  1. Edit a page
  2. Submit to our only workflow
  3. Result:
    • SHOULD BE: Workflow is submitted and the submitting user + assigned group receives an email about the submission
    • ACTUAL: The workflow is appears in the inbox correctly, but the emails are not sent out. The following error message is present in the logs:

 

Error while sending email. com.day.cq.workflow.impl.email.EMailNotificationService
java.lang.NullPointerException: null
at com.day.cq.workflow.impl.email.EMailNotificationService.sendNotification(EMailNotificationService.java:238)
at com.day.cq.workflow.impl.email.EMailNotificationService$EventProcessor.run(EMailNotificationService.java:551)
at java.lang.Thread.run(Thread.java:748)

 

 

As I mentioned, this author instance is cloned from an author instance where the configurations are identical, and the workflow emails are sending properly... So I'm at a loss for what might cause this. Any insight is appreciated, and I'm happy to work with suggested configuration adjustments if needed as this is on a staging environment clone.

 

Thanks,

Jared

12 Replies

Avatar

Community Advisor

The error stack trace should uncover where the null is initialed passed to the EmailNotificationService, can you check or post the complete stack trace and not only the initial lines?

 



Esteban Bustamante

Avatar

Level 4

Well, that's the thing... This is all that is being posted in the log.

JaredAtUD_0-1687533942492.png

 

Avatar

Level 4

Not on AEMaaCS, this is AMS/ACM. Regardless, going to see about accessing to grab the error.log.

Avatar

Community Advisor

Have you tried restarting the instance  ?

Seems to solve many config problems


Aanchal Sikka

Avatar

Level 4

The old tried and true. This was the first thing we tried though!

Avatar

Community Advisor

Hello @JaredAtUD 

 

  1. Please try to delete and re-create the config.
  2. Validate that the SMTP post is open for the clone instance.
  3. Please create a separate logger with Trace/Debug level, to check for any additional info.
  4. You can also try once with a demo smtp account, if that works. It will confirm that it is not an issue on the SMTP side.

Aanchal Sikka

Avatar

Community Advisor

Hello @JaredAtUD - 

 

  • Can you try fetching the logs from the error.log file to get more deeper insights here?

Also, from the basic troubleshooting standpoint could you please validate : 

  • That the AEM instance can successfully connect to the configured SMTP server. Test the connection by using a command-line tool or a separate email client to send an email using the same SMTP server details.
  • Confirm that the submitting user and assigned group have valid email addresses associated with their user accounts or group profiles. Incorrect or missing email addresses can cause issues with email notifications.

Avatar

Level 4

Will see about grabbing the full error.log.

 

...validate : 

  • That the AEM instance can successfully connect to the configured SMTP server. Yes, this instance is able to access the smtp server.
  • Confirm that the submitting user and assigned group have valid email addresses associated with their user accounts or group profiles. Incorrect or missing email addresses can cause issues with email notifications. Yes, all submitting accounts so far have had properly configured email addresses.

Avatar

Community Advisor

Since, it’s not a prod environment, can you check the log level to debug mode and try to run the workflow for smtp mail trigger? This will give you more detailed information on the issue.

Sometime it requires to whitelist your aem instance in address on smtp side fir this functionality to work. Can you check internally it was done past fir the prod environment 

Avatar

Level 4

Setting the log level to debug does not appear to generate any additional log output information. Wondering if I'm missing something in the configuration there... but otherwise nothing sticks out? Same error as in the original post is present, nothing more.

 

As for SMTP access

Avatar

Level 4

For anyone stumbling across this in the future still looking for an answer, a support rep replied to my ticket and suggested this is a known issue with SP17 on 6.5.

 

Ref: CQ-4353652

 

Good luck all!