[
https://issues.apache.org/jira/browse/SLING-2573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440087#comment-13440087
]
Chetan Mehrotra commented on SLING-2573:
----------------------------------------
This is probably happening because of a startup order.
ResourceResolverFactoryImpl which is responsible for setting the
requiredFactories in RootResourceProviderEntry has an Optional, Multiple
dependency on ResourceProviderFactory. So it can happen that when a
ResourceResolverFactory is published in OSGi SR it does not have any reference
to ResourceProviderFactory and in that time JcrResourceListener tries to access
it.
May be the dependency should be set to Required, Multiple to ensure that
ResourceResolverFactoryImpl is properly initialized.
For more details refer to http://markmail.org/thread/4jjqnlsefnqnkdtf
> JcrResourceListener activation is failing with NPE
> --------------------------------------------------
>
> Key: SLING-2573
> URL: https://issues.apache.org/jira/browse/SLING-2573
> Project: Sling
> Issue Type: Bug
> Components: JCR
> Reporter: Chetan Mehrotra
>
> The activate method of JcrResourceListener of org.apache.sling.jcr.resource
> is failing with NPE for 2.1.1.SNAPSHOT
> 22.08.2012 22:19:27.919 *ERROR* [FelixStartLevel]
> org.apache.sling.jcr.resource
> [org.apache.sling.jcr.resource.internal.JcrResourceListener] The activate
> method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException
> at
> org.apache.sling.jcr.resource.internal.JcrResourceListener.activate(JcrResourceListener.java:133)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
> at
> org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
> at
> org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)
> at
> org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)
> at
> org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146)
> at
> org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)
> at
> org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)
> at
> org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:997)
> at
> org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInterna
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira