karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Trenaman <trena...@progress.com>
Subject Re: Shutting down Karaf I get an 'IllegalStateException - Can only register services while bundle is active or activating"
Date Sun, 19 Sep 2010 11:34:57 GMT
Thanks Guillaume for the quick reply on a Sunday!

OK. Can I suggest that I submit the patch as is, so that we can get it 
into the code-base, and then we can look to fixing the issue? Many eyes 
may squash this bug.

Let me know if you're happy for me to submit the code.

Best,
Ade.

On 19/09/2010 21:29, Guillaume Nodet wrote:
> Not sure what the exact problem is but it does look like a bug in the
> arie blueprint implementation.
>
> On Sunday, September 19, 2010, adrian.trenaman
> <adrian.trenaman@googlemail.com>  wrote:
>    
>> Hi there,
>>
>> Have been doing some work on my Karaf archive deployer, which is working
>> nicely -except- when I shut down the Karaf instance: I see this nasty stack
>> trace. I've stepped through right to the Felix code and it seems that after
>> the unregister of my 'kar:' url handler service, the runtime tries to
>> register it again (why?!) and then this fails because the bundle in question
>> (org.apache.karaf.deployer.kar) is in a Stopping state - hence the
>> 'IllegalStateException'.
>>
>> I'll keep banging my head against this, but I'm keen to know if anyone else
>> out there has seen this or might have an idea of what I've done wrong. BTW,
>> I've based all my deployer code on the existing code for the features and
>> blueprints deployers.
>>
>> Thanks in advance,
>> Ade.
>>
>> ---
>>
>> java.lang.IllegalStateException: Can only register services while bundle is
>> active or activating
>>          at org.apache.felix.framework.Felix.registerService(Felix.java:2817)
>>          at
>> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251)
>>          at
>> org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:388)
>>          at
>> org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:166)
>>          at
>> org.apache.aries.blueprint.container.BlueprintContainerImpl.notifySatisfaction(BlueprintContainerImpl.java:596)
>>          at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.setSatisfied(AbstractServiceReferenceRecipe.java:393)
>>          at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceRemoved(AbstractServiceReferenceRecipe.java:385)
>>          at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceChanged(AbstractServiceReferenceRecipe.java:355)
>>          at
>> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:864)
>>          at
>> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:732)
>>          at
>> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)
>>          at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3726)
>>          at org.apache.felix.framework.Felix.access$000(Felix.java:80)
>>          at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:717)
>>          at
>> org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:135)
>>          at
>> org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:129)
>>          at
>> org.apache.aries.blueprint.container.ServiceRecipe.unregister(ServiceRecipe.java:183)
>>          at
>> org.apache.aries.blueprint.container.BlueprintContainerImpl.unregisterServices(BlueprintContainerImpl.java:657)
>>          at
>> org.apache.aries.blueprint.container.BlueprintContainerImpl.destroy(BlueprintContainerImpl.java:806)
>>          at
>> org.apache.aries.blueprint.container.BlueprintExtender.destroyContext(BlueprintExtender.java:204)
>>          at
>> org.apache.aries.blueprint.container.BlueprintExtender.bundleChanged(BlueprintExtender.java:196)
>>          at
>> org.apache.aries.blueprint.container.BlueprintExtender$BlueprintBundleTrackerCustomizer.modifiedBundle(BlueprintExtender.java:385)
>>          at
>> org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:453)
>>          at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:237)
>>          at
>> org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:413)
>>          at
>> org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:800)
>>          at
>> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:728)
>>          at
>> org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610)
>>          at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3715)
>>          at org.apache.felix.framework.Felix.stopBundle(Felix.java:2180)
>>          at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1172)
>>          at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>          at java.lang.Thread.run(Thread.java:637)
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/Shutting-down-Karaf-I-get-an-IllegalStateException-Can-only-register-services-while-bundle-is-active-tp1523512p1523512.html
>> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>>
>>      
>    

Mime
View raw message