Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

Error while dispatching observation events for //*[11111b]@org.apache.sling.jcr.resource.internal.JcrResourceListener java.lang.IllegalStateException: Resource resolver is already closed

Avatar

Level 1

After installing Service Pack 6.5.9 the following warning is logged quite often:

18.08.2021 14:43:23.068 *WARN* [sling-oak-observation-5] org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor Error while dispatching observation events for //*[11111b]@org.apache.sling.jcr.resource.internal.JcrResourceListener
java.lang.IllegalStateException: Resource resolver is already closed.
	at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:191) [org.apache.sling.resourceresolver:1.7.2]
	at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.getResource(ResourceResolverImpl.java:442) [org.apache.sling.resourceresolver:1.7.2]
	at org.apache.sling.resourceresolver.impl.mapping.MapEntries.addResource(MapEntries.java:257) [org.apache.sling.resourceresolver:1.7.2]
	at org.apache.sling.resourceresolver.impl.mapping.MapEntries.onChange(MapEntries.java:732) [org.apache.sling.resourceresolver:1.7.2]
	at org.apache.sling.resourceresolver.impl.observation.BasicObservationReporter.reportChanges(BasicObservationReporter.java:211) [org.apache.sling.resourceresolver:1.7.2]
	at org.apache.sling.jcr.resource.internal.JcrResourceListener.onEvent(JcrResourceListener.java:155) [org.apache.sling.jcr.resource:3.0.18]
	at org.apache.jackrabbit.commons.observation.ListenerTracker$1.onEvent(ListenerTracker.java:190) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.20.2]
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.contentChanged(ChangeProcessor.java:513) [org.apache.jackrabbit.oak-jcr:1.22.7]
	at org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher.contentChanged(FilteringDispatcher.java:52) [org.apache.jackrabbit.oak-core:1.22.7]
	at org.apache.jackrabbit.oak.spi.commit.BackgroundObserver$1$1.call(BackgroundObserver.java:127) [org.apache.jackrabbit.oak-store-spi:1.22.7]
	at org.apache.jackrabbit.oak.spi.commit.BackgroundObserver$1$1.call(BackgroundObserver.java:121) [org.apache.jackrabbit.oak-store-spi:1.22.7]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Other than filling up the logs there does not seem to be a functional impact.

Is there something we can do to prevent these warnings?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @rvk80 

 

This will not have any functional Impact. But if you want to suppress it, just create a logger configuration with level as "Error" and add the below config. It will be suppressed.

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
org.apache.sling.commons.log.file="logs/suppress.log"
org.apache.sling.commons.log.level="error"
org.apache.sling.commons.log.names="[org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor]"
org.apache.sling.commons.log.pattern="\{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}"/>

 

Highlighted one is the class form where you get the warning and can be updated with any class name you want to suppress.

 

Thanks!

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @rvk80 

 

This will not have any functional Impact. But if you want to suppress it, just create a logger configuration with level as "Error" and add the below config. It will be suppressed.

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
org.apache.sling.commons.log.file="logs/suppress.log"
org.apache.sling.commons.log.level="error"
org.apache.sling.commons.log.names="[org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor]"
org.apache.sling.commons.log.pattern="\{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}"/>

 

Highlighted one is the class form where you get the warning and can be updated with any class name you want to suppress.

 

Thanks!