AEM 6.3: Felix SCR Annotations Deprecated - Replacement for @SlingFilter? | Community
Skip to main content
timlwhite
New Participant
May 24, 2017
Solved

AEM 6.3: Felix SCR Annotations Deprecated - Replacement for @SlingFilter?

  • May 24, 2017
  • 16 replies
  • 24261 views

Hello, it appears that the Felix SCR annotations have been deprecated in AEM 6.3.  This is not reflected on the Sling website or documentation as far as I can tell, but is appearing that way when we compile against the 6.3 uberjar.

In fact, the latest AEM Maven Archetype does not include the Felix SCR dependency at all.

I see this blog post from last year that covers a lot of conversion questions.

And this very recent one from Feike.

The OSGi 6 method for registering configuration properties using a separate interface class is fairly convoluted, and thinly documented, but with enough time and money I am sure we can figure it out.

However, there does not seem to be mention in either article of what is replacing the @SlingFilter annotation, which is mentioned as the recommended approach even in fairly recent articles.

All our classes that use the @SlingFilter annotation no longer work (they are throwing ArrayIndexOutOfBounds exceptions), even keeping the Felix SCR dependency, and updating it to the latest version.

Is there documentation somewhere of what is replacing the @SlingFilter annotation?

Is there a plan for a more complete document describing the recommended migration path, and changes to the product that cause existing @SlingFilter usage not to work?

Thanks!

Tim

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

when using non-String types make sure to use the correct data-type.

Example here for the service-ranking and using :Integer

https://github.com/heervisscher/htl-examples/blob/master/core/src/main/java/com/adobe/examples/htl/core/bindings/CustomBindingProvider.java

16 replies

Feike_Visser1
Employee
February 10, 2018
New Participant
February 10, 2018

I use OSGI R6 annotation based approach:

@Component(service = Filter.class, property = {

EngineConstants.SLING_FILTER_SCOPE + "=" + EngineConstants.FILTER_SCOPE_REQUEST,

Constants.SERVICE_RANKING + ":Integer=" + -10002

})

public class MyCustomFilter implements Filter {

Feike_Visser1
Employee
May 29, 2017
timlwhite
timlwhiteAuthor
New Participant
May 25, 2017

Yes, most of the Felix annotations show deprecated when compiling against the 6.3 UberJar.  I'll try setting things up with @Component. Thanks!

Feike_Visser1
Feike_Visser1Accepted solution
Employee
May 25, 2017

when using non-String types make sure to use the correct data-type.

Example here for the service-ranking and using :Integer

https://github.com/heervisscher/htl-examples/blob/master/core/src/main/java/com/adobe/examples/htl/core/bindings/CustomBindingProvider.java

Feike_Visser1
Employee
May 25, 2017

I am not aware that the Felix annotations are deprecated in AEM6.3.

To your question on @SlingFilter, this is same like @SlingServlet

There isn't an equivalent you can use. You need to specify the properties like in this sample for a servlet.

https://github.com/heervisscher/htl-examples/blob/master/core/src/main/java/com/adobe/examples/htl/core/servlets/SimpleServlet.java