To use this Session session = resourceResolver.adaptTo(Session.class);need resourceResolver object which can get it via ResourceResolverFactory , below source code to get resource resolver , need to pass param object which will have system user.resourcerResolver = resourceResolverFactory.getService...