Hello.
I have a doTag() method where resource resolver is derived using:
SlingHttpServletRequest request = (SlingHttpServletRequest) pageContext.getRequest();
resRsolvr = request.getResourceResolver();
When am trying to close the resRsolvr object, My component never works.
May I know how to close this Object.
If am not closing this object am getting"Too many files open" in production.I
Solved! Go to Solution.
Hi,
At this occassion you don't open the resourceResolver, but you are just obtaining it; the resourceResolver has been opened by the Sling Engine, and the Sling Engine will also take care of closing it when all is done. Only close a resourceResolver if you have explicitly opened it (via the ResourceResolverFactory.login* methods).
The "too many open files" issue in your production environment has very likely a different root cause. Sling ResourceResolvers are not tied to files in the filesystem or network connections. The next time such a situation occurs in production, use a tool like "lsof" to list all open file of the AEM process, and then raise a Daycare ticket as well and provide this data to Adobe support.
Regarding lsof this page might help: https://www.howtoforge.com/linux-lsof-command/#-how-to-list-filesnbspspecific-to-a-process
Jörg
Hi,
At this occassion you don't open the resourceResolver, but you are just obtaining it; the resourceResolver has been opened by the Sling Engine, and the Sling Engine will also take care of closing it when all is done. Only close a resourceResolver if you have explicitly opened it (via the ResourceResolverFactory.login* methods).
The "too many open files" issue in your production environment has very likely a different root cause. Sling ResourceResolvers are not tied to files in the filesystem or network connections. The next time such a situation occurs in production, use a tool like "lsof" to list all open file of the AEM process, and then raise a Daycare ticket as well and provide this data to Adobe support.
Regarding lsof this page might help: https://www.howtoforge.com/linux-lsof-command/#-how-to-list-filesnbspspecific-to-a-process
Jörg
Thank you so much for the help. I was also thinking the same. We have a ticket with adobe, they closed saying custom code issues.
Now I will re-open it.
This was very helpful.
Thanks,
Tulasi.
Views
Replies
Total Likes