rajneeshg, there are few things I'd try to get it fix.
- use resourceResolverFactory.getServiceResourceResolver(resourceResolverProps); instead of "resourceResolverFactory.getResourceResolver(resourceResolverProps);"
- immediately after getting the "resourceResolver" object check to see the mapped System User: resourceResolver.getUserID(); this should map the system user you mapped; if it does not return the user you mapped then check your configuration, must likely you didn't add the right bundleId to the mapping
- Once you are sure you are using the system user you created and still cannot access the data then try assigning the user to the administrators group, this way you can rule out permission issues. Once you do get access to the data you need then remove the user from the administrators group and assigned tailored permissions
/* get a handle to the resourceResolver */
logger.info("get ResourceResolver");
// prepare params to get system user
Map<String, Object> serviceParams = new HashMap<String, Object>();
serviceParams.put(ResourceResolverFactory.SUBSERVICE, SUBSERVICE);
try {
// get resource resolver for the system user set in user mapper
ResourceResolver resourceResolver = resourceResolverFactory.
getServiceResourceResolver(serviceParams);
/* get a handle to ReplicationStatus */
logger.info("get ReplicationStatus using user: " + resourceResolver.getUserID());
Resource resource = resourceResolver.getResource(PAGE_CHECK_REPLICATION);
logger.info("Resource: " + resource.getPath());
ReplicationStatus replicationStatus = resource.adaptTo(ReplicationStatus.class);
/* show replication status of the resource */
logger.info("LAST REPLICATION USER: " + replicationStatus.getLastPublishedBy());
PrintWriter out = response.getWriter();
out.print ("REPLICATION USER FOR " + PAGE_CHECK_REPLICATION + " IS " +
replicationStatus.getLastPublishedBy());
out.flush();
out.close();
} catch (LoginException e) {
e.printStackTrace();
}