com.adobe.cq.commerce.common.ServiceContext

Avatar

Avatar

vijays80591732

Avatar

vijays80591732

vijays80591732

24-09-2018

Hi All,

I'm working in an Felix to OSGI migration activity. As part of this I'm facing the below issue. Can anyone help me on this?

com.adobe.cq.commerce.common.ServiceContext.languageManager returns null in AEM 6.4 using OSGI annotations. The same is working fine in AEM 6.1 with felix annotations. Additionally not only languageManager, for these also I'm getting null SearcProviderManager, settingService, slingRepository, slingSettingService & userPropertiesService.

1578151_pastedImage_1.png

Thanks,

Vijay

Replies

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

24-09-2018

Can you post more of your code - where is it failing - using @Reference?

Avatar

Avatar

vijays80591732

Avatar

vijays80591732

vijays80591732

24-09-2018

Hi Smac,

Please find the below references,

Screenshot:1

1578953_pastedImage_0.png

Screenshot:2

1578957_pastedImage_8.png

Screenshot:3

1578955_pastedImage_4.png

Screenshot:4

1578956_pastedImage_6.png

Issue in detail:

1) In screenshot:1 line no:91, I'm trying to get the languageManager from config.

2) In screenshot:2 line no:55 I'm getting properties from serviceFactory. serviceFactory is nothing but DefaultHybrisfactory.

3) In screenshot:3 DefaultHybriFactory extends AbstarctJcrCommerceServiceFactory where the languageManager has been referred.

4) In screenshot:4 If you see the AbstarctJcrCommerceServiceFactory predefined class, it has the LanguageManager Reference, but here everything is in felix annotation.

5) Finally when I get the languageManager from AbstarctJcrCommerceServiceFactory I'm getting null value.(I'm using OSGI annotations)

6) The same code is working fine in 6.1 with felix annotations(felix annotations used in my code not OSGI)

I'm suspecting that, Since I have converted all the felix annotations to OSGI in my code but the predefined class (AbstarctJcrCommerceServiceFactory) is still having felix annotations. that's why I'm getting null value?

Thanks,

Vijay

Avatar

Avatar

vijays80591732

Avatar

vijays80591732

vijays80591732

26-09-2018

Hi Smac,

Do you have any idea on this issue?

Thanks,

Vijay

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

27-09-2018

This may be a bug. If code works in Felix Annotations but fails on R6 Annotations - you should open a support ticket.