Hi ,
we recently upgraded from 5.6.1 to AEM 6.2.
we have a following logic in one of OSGI services.
we are getting the below exception only in publisher while the same logic is working fine in author.
we have given currently the root permissions for the user- xml service and used it in user mapper service along with amendment configurations.
please help in resolving the below issue.
LOGIC:
Map<String, Object> param = new HashMap<String, Object>();
param.put(ResourceResolverFactory.SUBSERVICE, "XmlService");
try {
//return factory.getAdministrativeResourceResolver(null);
return factory.getServiceResourceResolver(param);
} catch (Exception e) {
LOG.info("exception for resource resolver is:" , e);
throw new RepositoryAccessException("Unable to get administrative resource resolver", e);
}
Resource resource = resolver.getResource("/etc/leads/templates/" + file + ".xml");
LOG.info("the resource is :"+resource.getPath());
InputStream is = resource.adaptTo(InputStream.class);
EXCEPTION:
/content/drive/en_gb/cars/new/corporates/request-a-demo/_jcr_content/formsPar/form.submit.html HTTP/1.1] com.lux.drive.sales.countrySpecific.en.service.formatter.XmlService total exception inside format lead main method is :
java.lang.IllegalStateException: Resource resolver is already closed.
at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:202)
at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.getResource(ResourceResolverImpl.java:641)
at