Day CQ Mail Service Configuration not working | Community
Skip to main content
Level 2
October 16, 2015
Solved

Day CQ Mail Service Configuration not working

  • October 16, 2015
  • 4 replies
  • 4329 views

We are using Day CQ Mail Service Configuration to send mails. I have referenced the configuration using the following code in my service impl.

@Reference private MessageGatewayService messageGatewayService; @Reference private MessageGateway<HtmlEmail> messageGateway;

We are supplying the configuration values through the config nodes.After the code build , we are able to see the SMTP server values in the Day CQ Mail Service Felix configuration. The issue is that when I am submitting the form to send a mail , it throws a MailingException logging "Invalid Mail Service Configuration". Even though the configuration values are all proper , it still throws the same exception.

To resolve this issue , we went to the corresponding bundle "Day Communique 5 Mailercom.day.cq.cq-mailer" and restarted the bundle. Then the configuration started working and we were able to send emails.

Why do I have to explicitly go and restart the CQ OOTB Bundle to make the configuration work ?

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 kautuk_sahni

Hi 

The restarting of Bundle results in:

1. Changes to the individual configuration properties will take effect upon restart.

2. Restart the entire OSGi helps resolve/refresh the installed bundles, their bundle contexts and dependencies.

 

Please have a look at OSGI life-cycle: - http://eclipsesource.com/blogs/2013/01/23/how-to-track-lifecycle-changes-of-osgi-bundles/

I hope this will help you.

 

Thanks and Regards

Kautuk Sahni

4 replies

Kashyap_PAuthor
Level 2
October 16, 2015

I tailed the error logs during code build. There is no error. Now I saw a strange thing. This issue is occurring only in our UAT environment. I saw that the Day CQ Mail Service Configuration  in felix console are of two different versions. I am sure we are using the same AEM 6.0 and Service Pack 2.0 combination in all the environments.

Version in Local , Dev and QA - Day Communique 5 Mailer (com.day.cq.cq-mailer), Version 5.8.12 (No issues)

Version in UAT - Day Communique 5 Mailer (com.day.cq.cq-mailer), Version 5.8.14 (Issue occurring)

 

Is there any possibility that AEM can auto-update itself with the latest versions ?

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
October 16, 2015

Hi 

The restarting of Bundle results in:

1. Changes to the individual configuration properties will take effect upon restart.

2. Restart the entire OSGi helps resolve/refresh the installed bundles, their bundle contexts and dependencies.

 

Please have a look at OSGI life-cycle: - http://eclipsesource.com/blogs/2013/01/23/how-to-track-lifecycle-changes-of-osgi-bundles/

I hope this will help you.

 

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
edubey
Level 10
October 16, 2015

Yes, AEM may prefer higher version if its available,

To get detail understanding, check this out: http://blog.christianposta.com/osgi/understanding-how-osgi-bundles-get-resolved-part-i/

edubey
Level 10
October 16, 2015

When you build your project did you find any error in  logs? , If you didn't check, can you check this now.