Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM 6.3 Scr annotation issue while upgrade

Avatar

Level 2

HI All,

      As you all know SCR annotations are deprecated in 6.3 and we are moving towards OSGI R6 annotations, there was no workaround in 6.3 to overcome the issues with existing code written using SCR annotations in lower version AEM. Configuration binding is not updating jar associated with it.

I found blogs related to the difference of the two and the implementation of OSGI R6, but couldn't find a solution for the later issue. Can anyone help in resolving this issue, as changing the annotations in existing code involves more manual effort and it would be better if there is a hot fix or some workaround for it .

1361774_pastedImage_0.png

Thanks,

Gokul

1 Accepted Solution

Avatar

Correct answer by
Level 10

SRC annotation still work in AEM 6.3 - you can still build a project with Maven Archetype 10 and use for example @SlingServlet - which would not be available in DS annotations - ie - Maven Archetype 11.

But you are correct - if you have SRC annotations in a project and you want to use DS - you have to manually rebuild the code.

View solution in original post

9 Replies

Avatar

Correct answer by
Level 10

SRC annotation still work in AEM 6.3 - you can still build a project with Maven Archetype 10 and use for example @SlingServlet - which would not be available in DS annotations - ie - Maven Archetype 11.

But you are correct - if you have SRC annotations in a project and you want to use DS - you have to manually rebuild the code.

Avatar

Level 2

Thanks for the reply. we are facing another issue which is configuration binding . It is not automatically happening when we deploy the code in aem 6.3. Can you please provide your insights on that ?

Avatar

Level 2

Hi gokulkrish/smacdonald2008,

I am facing the same issue. We are using multimodule-content-package-archetype and upgrading from AEM 6.1 to 6.3.

Problem we are facing is that, the components (Replication listeners) are not working correctly. When we check config manager we find that Listener is bound to launchpad:resources/install/0/org.apache.sling.scripting.core-2.0.44.jar rather than our application bundle.

This causes as issue when during the component activation as the OSGI configuration doesn't load.

Can you please reply if you have found a fix for your problem?

Thanks and Regards,

Deepak

Avatar

Level 2

just to give some more information on the issue.

1. We first un-installed the package that we had.

2. Deployed the package again.

3. At this point, in the configuration manager tab, bundle column shows blank and in component tab we can see the OSGI properties in the component

4. When we trigger the functionality which invokes the replication listener and the component works fine

5. Next invocation on same listener doesn't work properly and component looses, OSGI property. On Configuration manager tab, bundle column has launchpad:resources/install/0/org.apache.sling.scripting.core-2.0.44.jar.

After this all further invocation fails as the OSGI configuration is bound to wrong bundle. Please advise what may be causing this issue.

Same code works fine in AEM 6.3

Avatar

Level 2

is this issue resolved? I am also facing same issue.

Avatar

Level 10

Did you rebuild your code with latest dependencies?

Avatar

Level 2

Yes, i did and still getting the same issue.

Avatar

Level 2

Worked fine for me. Thanks a lot.