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
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @shajiahmed!
Please verify that your request matches all requirements defined in your servlets component annotation:
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!
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!
I already check as I mentioned in the post Ankur Khare's link, all of them active and resolving properly.
Hi @shajiahmed!
Please verify that your request matches all requirements defined in your servlets component annotation:
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!
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",
I faced same issue and this is because of Unsatisfied references in the service which I called from my servlet. So go to http://localhost:4502/system/console/components and verify your servlet/service if all the references are satisfied or not. If not satisfied you will get this error.
Views
Likes
Replies
Views
Likes
Replies