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

ASF GitHub Bot commented on KARAF-3864:
---------------------------------------

GitHub user mcculls opened a pull request:

    https://github.com/apache/karaf-cellar/pull/11

    KARAF-3864: check if we're in a shutdown situation before checking isEnabled

    https://issues.apache.org/jira/browse/KARAF-3864

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mcculls/karaf-cellar 
KARAF-3864-avoid-cellar-warning-on-shutdown

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/karaf-cellar/pull/11.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #11
    
----
commit cf867fdff73b12410c4802218defe91a16d24398
Author: Stuart McCulloch <[email protected]>
Date:   2015-07-20T15:33:42Z

    KARAF-3864: check if we're in a shutdown situation before checking isEnabled

----


> Warning when shutting down system with karaf-cellar installed
> -------------------------------------------------------------
>
>                 Key: KARAF-3864
>                 URL: https://issues.apache.org/jira/browse/KARAF-3864
>             Project: Karaf
>          Issue Type: Bug
>          Components: cellar-bundle
>            Reporter: Stuart McCulloch
>         Attachments: KARAF-3864-swap-checks.patch
>
>
> We're experimenting with karaf-cellar 3.0.3 on top of karaf 3.0.4 and get the 
> following warning if the system is forcibly stopped:
> {code}
> 2015-07-20 16:19:03,397+0100 WARN  [FelixShutdown]  
> org.apache.karaf.cellar.bundle.LocalBundleListener - CELLAR BUNDLE: can't 
> check listener configuration
> org.osgi.service.blueprint.container.ServiceUnavailableException: The 
> Blueprint container is being or has been destroyed: 
> (objectClass=org.osgi.service.cm.ConfigurationAdmin)
>       at 
> org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:240)
>  [org.apache.aries.blueprint.core:1.4.3]
>       at 
> org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:55)
>  [org.apache.aries.blueprint.core:1.4.3]
>       at 
> org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:298)
>  [org.apache.aries.blueprint.core:1.4.3]
>       at Proxy90cff4fa_9fee_4d56_85e6_c006a413befa.getConfiguration(Unknown 
> Source) [na:na]
>       at 
> org.apache.karaf.cellar.bundle.LocalBundleListener.isEnabled(LocalBundleListener.java:150)
>  [org.apache.karaf.cellar.bundle:3.0.4.SNAPSHOT]
>       at 
> org.apache.karaf.cellar.bundle.LocalBundleListener.bundleChanged(LocalBundleListener.java:51)
>  [org.apache.karaf.cellar.bundle:3.0.4.SNAPSHOT]
>       at 
> org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:868)
>  [org.apache.felix.framework-4.2.1.jar:na]
>       at 
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
>  [org.apache.felix.framework-4.2.1.jar:na]
>       at 
> org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
>  [org.apache.felix.framework-4.2.1.jar:na]
>       at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403) 
> [org.apache.felix.framework-4.2.1.jar:na]
>       at org.apache.felix.framework.Felix.stopBundle(Felix.java:2520) 
> [org.apache.felix.framework-4.2.1.jar:na]
>       at org.apache.felix.framework.Felix$2.run(Felix.java:959) 
> [org.apache.felix.framework-4.2.1.jar:na]
>       at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80]
> {code}
> Looking at the LocalBundleListener code it checks if the listener is enabled 
> before going on to check whether the system is shutting down. However the 
> "isEnabled" check uses the blueprint-injected ConfigurationAdmin service 
> which is not available during shutdown. Swapping these checks round fixes the 
> issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to