com.adobe.cq.commerce.common.ServiceContext

Avatar

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile
vijays80591732
Level 2

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
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

24-09-2018

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

Avatar

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile
vijays80591732
Level 2

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
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile
vijays80591732
Level 2

26-09-2018

Hi Smac,

Do you have any idea on this issue?

Thanks,

Vijay

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

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.