How can I find out what is causing a certain URL to be resolved to a synthetic resources?

StackOverflow https://stackoverflow.com/questions/22834912

  •  26-06-2023
  •  | 
  •  

Question

On my Adobe CQ 5 (CQ 5.6) installation, for some reason, there's a URL (http://localhost:4503/services) that is getting resolved to a synthetic resource:

/services is resolved to a synthetic resource

This is causing CQ to show the following page, rather than a 404 Page Not Found page:

Forbidden response when accessing /services

What is causing this behavior?

Was it helpful?

Solution

You get Forbidden error not because of the strange type of the /services, but because you didn't add any extension (you'll get the same result requesting /content/geometrixx). Let's try to add some extension: .html doesn't really work, but .infinity.tidy.json results in interesting discovery:

{
  "tagfilter": {
    "sling:resourceType": "/services/tagfilter.servlet",
    "servletClass": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet",
    "sling:resourceSuperType": "sling/bundle/resource",
    "servletName": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet"
  },
  "tagfilter.servlet": {
    "sling:resourceType": "/services/tagfilter.servlet",
    "servletClass": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet",
    "sling:resourceSuperType": "sling/bundle/resource",
    "servletName": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet"
  },
  ...

It seems that /services is a virtual (or, well, synthetic) path, a parent for servlets. In fact, you can't bind servlet to any path, the most popular choice is /bin prefix, however /services is possible as well. You'll find a list of all such paths in Apache Sling Servlet/Script Resolver and Error Handler OSGi configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top