Below is a weird scenario i am facing. I am having a publish instance with dispatcher in front of it.
I am using a servlet to be called from third party application with URL similar to /bin/mysevlet?id=123&action=readDetails. In this servlet i am processing based on id passed and once done, i am forwarding it to another page in AEM using below code
dispatcher=request.getRequestDispatcher(aemURL); dispatcher.forward(request, response);
Servlet is called fine from external party and once controls comes to forward, i get below error.
Message: org.apache.sling.api.SlingException: Exception during response processing.
Referer : third party URL.
In logs i get below exception
*ERROR* org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing. javax.jcr.RepositoryException: org.apache.sling.api.resource.PersistenceException: Resource at '/content/app1/en/getdetails' is not modifiable.
Caused by: org.apache.sling.api.resource.PersistenceException: Resource at '/content/app1/en/getdetails' is not modifiable.
Has anybody faced this issue. For me it seems to be case when anonymous user is not able to render page being forwarded.
I guess that this request from the external party is a POST request. And when you forward this request, you end up doing a POST request to a resource. This POST request is handled by the DefaultPostServlet, which tries to write the resource, but it cannot perform this write operation due to insufficient permissions.
Please doublecheck, that the forwarding works correctly. I don't know if forwarding is the right thing if you want to respond only with the content of a page.
Here is the list of things which you could check to debug this problem.
Let me know if above points help & resolve your issue.