Expand my Community achievements bar.

SOLVED

Day CQ Mail Service Configuration not working

Avatar

Level 2

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 ?

1 Accepted Solution

Avatar

Correct answer by
Administrator

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

View solution in original post

4 Replies

Avatar

Level 10

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

Avatar

Level 10

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/

Avatar

Correct answer by
Administrator

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

Avatar

Level 2

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 ?