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

Invalid recursion selector value issue in AEM 6.5

Avatar

Avatar
Give Back 5
Level 2
shajiahmed
Level 2

Likes

5 likes

Total Posts

50 posts

Correct Reply

3 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile

Avatar
Give Back 5
Level 2
shajiahmed
Level 2

Likes

5 likes

Total Posts

50 posts

Correct Reply

3 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile
shajiahmed
Level 2

06-05-2021

we recently moved from 6.2 to 6.5, we converted felix to osgi. There are several servlets that is showing 400 with following message

Invalid recursion selector value 'abc'

Cannot serve request to /content/mysite/en-us/some/application/page/_jcr_content.abc.json in org.apache.sling.servlets.get.DefaultGetServlet

Here is my servlet class

@component(service = Servlet.class, property = {
SLING_SERVLET_RESOURCE_TYPES + "={/apps/xxx/components/structure/resourcetype, xxx/components/structure/resourcetype}",
SLING_SERVLET_METHODS + "=GET",
SLING_SERVLET_EXTENSIONS+"=json",
SLING_SERVLET_SELECTORS+"=abc"})
public class SampleServlet extends SlingSafeMethodsServlet {

http://localhost:4502/content/mysite/en-us/some/application/page/_jcr_content.abc.json
As per the following post form Ankur_Khare, I checked servlet status it is in active state
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/invalid-recursion-selector...
I checked resolver map in system console, path is getting resolved and mapped, however I am still getting the
incursion selector error

@Ankur_Khare

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Employee
markus_bulla_adobe
Employee

Likes

104 likes

Total Posts

86 posts

Correct Reply

44 solutions
Top badges earned
Boost 100
Applaud 25
Affirm 25
Boost 50
Boost 25
View profile

Avatar
Boost 100
Employee
markus_bulla_adobe
Employee

Likes

104 likes

Total Posts

86 posts

Correct Reply

44 solutions
Top badges earned
Boost 100
Applaud 25
Affirm 25
Boost 50
Boost 25
View profile
markus_bulla_adobe
Employee

07-05-2021

Hi @shajiahmed!

 

Please verify that your request matches all requirements defined in your servlets component annotation:

  • It's a GET request (probably true)
  • It has the correct extension (json; looks good)
  • It has the correct selector (abc; looks good)
  • The resource at the requested path matches one of your listed resourceTypes - this could potentially be an issue.

I'm not sure about the resourceTypes listed in your example. Does your real world code also end with "/resourcetype"? Usually, these would look something like "weretail/components/structure/page". The actual naming is not important but they have to match between the "sling:resourceType" property in the content and the according definition in your servlet. So if your servlet registers for "xxx/components/structure/resourcetype" you should have the exact same string in the sling:resourceType property of /content/mysite/en-us/some/application/page/jcr:content.

 

You can double check on the resolution of your request in the Web Consoles Sling Servlet Resolver UI: http://localhost:4502/system/console/servletresolver to see how the request URL is decomposed (into selectors, extension, suffix) and what servlets are evaluated as candidates to handle the request. In addition to that you may also want to check what the Web Consoles Resource Resolver at http://localhost:4502/system/console/jcrresolver has to say about your request.

 

If things still don't work es expected, you may want to remove some of the restrictions for your servlets component registration (e. g. just register for the GET method and the "abc" selector) and see if that works. If it does, you can add the others properties one by one to see which one "breaks" the expected behavior.

 

Hope that helps!

Answers (2)

Answers (2)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,346 likes

Total Posts

3,220 posts

Correct Reply

914 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,346 likes

Total Posts

3,220 posts

Correct Reply

914 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

08-05-2021

Hi,

Just update the below line in your code. if you want to use multiple resourcetype then use multiple lines

SLING_SERVLET_RESOURCE_TYPES + "=xxx/components/structure/resourcetype", 

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

06-05-2021

Hi @shajiahmed 

 

Please check if all the services that you are using in your servlet are resolving properly and all are in active state. All the services needs to be active.

 

Thanks!