[
https://issues.apache.org/jira/browse/SLING-11649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Norman resolved SLING-11649.
---------------------------------
Resolution: Fixed
Merged PR at:
[{{993e5a8}}|https://github.com/apache/sling-org-apache-sling-bundleresource-impl/commit/993e5a891e35cc0e2de10811068b069e2b3e82dc]
> Check for null BundleContext while registering bundle resources
> ---------------------------------------------------------------
>
> Key: SLING-11649
> URL: https://issues.apache.org/jira/browse/SLING-11649
> Project: Sling
> Issue Type: Bug
> Reporter: Eric Norman
> Assignee: Eric Norman
> Priority: Major
> Fix For: Bundle Resource 2.3.6
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> While registering bundle resources the BundleContext may be null in some
> circumstances.
> I have encountered this stack trace:
> {noformat}
> java.lang.NullPointerException: null
> at
> org.apache.sling.bundleresource.impl.BundleResourceProvider.registerService(BundleResourceProvider.java:69)
> [org.apache.sling.bundleresource.impl:2.3.4]
> at
> org.apache.sling.bundleresource.impl.Activator.addBundleResourceProvider(Activator.java:142)
> [org.apache.sling.bundleresource.impl:2.3.4]
> at
> org.apache.sling.bundleresource.impl.Activator.bundleChanged(Activator.java:99)
> [org.apache.sling.bundleresource.impl:2.3.4]
> at
> org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915)
> at
> org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834)
> at
> org.apache.felix.framework.EventDispatcher.run(EventDispatcher.java:1147)
> at
> org.apache.felix.framework.EventDispatcher.access$000(EventDispatcher.java:54)
> at
> org.apache.felix.framework.EventDispatcher$1.run(EventDispatcher.java:102)
> at java.base/java.lang.Thread.run(Thread.java:829)
> {noformat}
> Expected:
> Check for null BundleContext before using it and report a more meaningful
> error message if null.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)