내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Close resourceResolver from JSP

Avatar

Level 5

JSP is calling some APIs which resides inside the bundle and performing some operations with ResourceResolver object. These APIs which resides inside the bundles are getting the resourceResolver object from the SlingRequest like -  resourceResolver = SlingHttpServletRequest.getResourceResolver();    

When I am trying to close the resourceResolver object inside the APIs or in the JSP page inside the finally block after the code execution, it is throwing exception that "Resource Resolver is already closed". 

Please advice, should i close the ResouceResolver after execution of the APIs or i can let it open to make my code working.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee Advisor

You are not required to close the resource resolver which is bound to the request object as it is opened/managed by the Sling internally. You should close only those resource resolvers which you open explicitly yourself in your code. 

원본 게시물의 솔루션 보기

2 답변 개

Avatar

정확한 답변 작성자:
Employee Advisor

You are not required to close the resource resolver which is bound to the request object as it is opened/managed by the Sling internally. You should close only those resource resolvers which you open explicitly yourself in your code. 

Avatar

Level 5

Thanks Kunal, very much appreciated.