You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Eric Norman (Jira)" <ji...@apache.org> on 2022/10/23 20:34:00 UTC

[jira] [Commented] (SLING-11649) Check for null BundleContext while registering bundle resources

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

Eric Norman commented on SLING-11649:
-------------------------------------

PR #2 contains the proposed changes for review and feedback

> 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: 0.5h
>  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)