You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2015/07/28 08:20:04 UTC

[jira] [Comment Edited] (SLING-4910) NPE in JCrResourceBundleProvider

    [ https://issues.apache.org/jira/browse/SLING-4910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14643887#comment-14643887 ] 

Konrad Windszus edited comment on SLING-4910 at 7/28/15 6:19 AM:
-----------------------------------------------------------------

[~chetanm] Yes, indeed this is related to my changes. Thanks for noticing.
While looking at the code I am wondering why the {{ResourceResolverFactory}} is a dynamic reference at all (https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java#L104). IMHO this should be static, and loosing it should lead to the JcrResourceBundleProvider being deactivated!


was (Author: kwin):
[~chetanm] Yes, indeed this is related to my changes. Thanks for noticing.
While looking at the code I am wondering why the {{ResourceResolverFactory}} is a dynamic reference at all (https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java#L104). IMHO this should be static, and loosing it should lead to the JcrResourceBundleProvider being reactivated!

> NPE in JCrResourceBundleProvider
> --------------------------------
>
>                 Key: SLING-4910
>                 URL: https://issues.apache.org/jira/browse/SLING-4910
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>            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)