[
https://issues.apache.org/jira/browse/SLING-4910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14694264#comment-14694264
]
Alexander Klimetschek edited comment on SLING-4910 at 8/12/15 10:10 PM:
------------------------------------------------------------------------
I assume there was a good reason for the ResourceResolverFactory reference to
be dynamic. Unfortunately it's not visible from the version history, this was
present before the [move sling to TLP location
commit|https://github.com/apache/sling/commit/cc7e95b8c6d2748a2dd2c59bb6c045892fc6f40b].
My guess would be that restarts of this service should be avoided, since
requests depend on it via the I18n filter and that should not depend on the
resource resolver... though that seems unnecessary, if the resolver factory is
gone, request handling is blocked anyway, right?
[~fmeschbe] [~cziegeler] Do you remember?
The NPE can be fixed simply by guarding any access to the resolver if we
need/want to keep the dynamic reference.
was (Author: alexander.klimetschek):
I assume there was a good reason for the ResourceResolverFactory reference to
be dynamic. Unfortunately it's not visible from the version history, this was
present before the [move sling to TLP location
commit|https://github.com/apache/sling/commit/cc7e95b8c6d2748a2dd2c59bb6c045892fc6f40b].
My guess would be that restarts of this service should be avoided, since
requests depend on it via the I18n filter and that should not depend on the
resource resolver... though that seems unnecessary, if the resolver factory is
gone, request handling is blocked anyway, right?
[~fmeschbe] [~cziegeler] Do you remember?
> NPE in JCrResourceBundleProvider
> --------------------------------
>
> Key: SLING-4910
> URL: https://issues.apache.org/jira/browse/SLING-4910
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Affects Versions: i18n 2.4.4
> Reporter: Chetan Mehrotra
> Assignee: Konrad Windszus
> Priority: Minor
> Fix For: i18n 2.4.4
>
>
> At fresh startup seeing couple of exceptions like below. Looks like by the
> time events are delivered ResourceResolverFactory is still not set
> (ResourceResolverFactory is missing. Cannot create ResourceResolver) which
> later causes NPE.
> {noformat}
> 28.07.2015 09:37:49.803 *ERROR* [Thread-36]
> org.apache.sling.i18n.impl.JcrResourceBundleProvider getResourceResolver:
> ResourceResolverFactory is missing. Cannot create ResourceResolver
> 28.07.2015 09:37:49.804 *WARN* [Thread-36] org.apache.felix.eventadmin
> Service [org.apache.sling.i18n.impl.JcrResourceBundleProvider,160,
> [org.apache.sling.i18n.ResourceBundleProvider,
> org.osgi.service.event.EventHandler]] EventAdmin: Exception during event
> dispatch [org.osgi.service.event.Event
> [topic=org/apache/sling/api/resource/Resource/ADDED] |
> [org.apache.sling.i18n.ResourceBundleProvider,
> org.osgi.service.event.EventHandler] | Bundle(org.apache.sling.i18n [93])]
> (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at
> org.apache.sling.i18n.impl.JcrResourceBundle.refreshSession(JcrResourceBundle.java:98)
> at
> org.apache.sling.i18n.impl.JcrResourceBundleProvider.isDictionaryResource(JcrResourceBundleProvider.java:250)
> at
> org.apache.sling.i18n.impl.JcrResourceBundleProvider.handleEvent(JcrResourceBundleProvider.java:229)
> at
> org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)
> at
> org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks$1.run(SyncDeliverTasks.java:145)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)