The way you get the resourceResolver is fine, however you must close it. The golden rule is "you create, you close".Normally you can do this in a finally{} clause, or if you use 6.2 or above you can benefit from the AutoCloseable implementation.Example here: https://github.com/heervisscher/htl-examp...