Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

3 Gotchas in Migrating from Felix SCR to OSGi R6 Annotations

Avatar

Avatar
Validate 1
Level 5
dan_klco
Level 5

Likes

53 likes

Total Posts

88 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Shape 1
Ignite 5
Ignite 40
Ignite 30
View profile

Avatar
Validate 1
Level 5
dan_klco
Level 5

Likes

53 likes

Total Posts

88 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Shape 1
Ignite 5
Ignite 40
Ignite 30
View profile
dan_klco
Level 5

21-05-2018

Avoid these three gotchas to make your migration from ApacheFelix SCR Annotations -> OSGi R6 DS Annotations quick and painless!

3 Gotchas in Migrating from Felix SCR to OSGi R6 Annotations – Perficient+Adobe

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 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,408 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

21-05-2018

Thanks Dan!

Avatar

Avatar
Level 1
sanjeevk2270226
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
sanjeevk2270226
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
sanjeevk2270226
Level 1

23-05-2018

Thanks @smacdonald2018, @dan.klco.

I am facing weird issue when migrating to OSGI DS. I am referring the following osgi service and configuration

Service: https://github.com/nateyolles/aem-osgi-annotation-demo/blob/master/core/src/main/java/com/nateyolles...

Config: https://github.com/nateyolles/aem-osgi-annotation-demo/blob/master/core/src/main/java/com/nateyolles...

Deploy for first time works. However when I override this config by adding the following file to /apps/test/config.author/com.test.core.services.SampleOsgiServiceImpl-code.xml. After deploying I see two configuration files in /system/console/configMgr:

1. one with default config from code

2. second with updated property I added in following config, rest of the properties also show up and inherited from default code configuration.

file:/apps/test/config.author/com.test.core.services.SampleOsgiServiceImpl-code.xml

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
   jcr:primaryType="sling:OsgiConfig"
   servicename.propertyname.string = "TESTTEST1"
/>

I hope I am not the first one to try this scenario!! please let me know if I am missing anything?

I've also tried the service, configuration from https://blog.osoco.de/2015/08/osgi-components-simply-simple-part-ii/ , then override with a config file in /apps. Same issue - I see two configs in configMgr.

Avatar

Avatar
Validate 1
Level 5
dan_klco
Level 5

Likes

53 likes

Total Posts

88 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Shape 1
Ignite 5
Ignite 40
Ignite 30
View profile

Avatar
Validate 1
Level 5
dan_klco
Level 5

Likes

53 likes

Total Posts

88 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Shape 1
Ignite 5
Ignite 40
Ignite 30
View profile
dan_klco
Level 5

24-05-2018

sanjeevk2270226​ Why are you adding -config to your configuration PID? The file name should exactly match the PID of the service being registered. Adding -config may cause OSGi to treat the service as a factory and register multiple configuration. Try renaming /apps/test/config.author/com.test.core.services.SampleOsgiServiceImpl-code.xml to /apps/test/config.author/com.test.core.services.SampleOsgiServiceImpl.xml

Avatar

Avatar
Level 1
sanjeevk2270226
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
sanjeevk2270226
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
sanjeevk2270226
Level 1

24-05-2018

dan.klco​ Thank you this worked.