Anonymous access not allowed by configuration - requesting credentials
So I'm getting this error org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials whenever I try to invoke my servlet from DefaultHttpClient. Here is my code
HttpPost post = new HttpPost("http://localhost:4502/bin/sitemap/demo"+"?rootPath="+"/content/geometrixx");
@SuppressWarnings("deprecation")
org.apache.http.impl.client.DefaultHttpClient client = new org.apache.http.impl.client.DefaultHttpClient();
org.apache.http.HttpResponse response = null;
response = client.execute(post);
I did exactly the same as suggested in helpx articles listed below but still not working.
https://helpx.adobe.com/experience-manager/using/post_files.html
https://helpx.adobe.com/experience-manager/using/multiple-digital-assets.html
Please help.