Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Blueprint - destroy-method not being called(NullPointerException in ShutdownSorter.getBundles)
Blueprint - destroy-method not being called [message #905499] Thu, 30 August 2012 13:59 Go to next message
Brad - is currently offline Brad -Friend
Messages: 2
Registered: August 2012
Junior Member
Hi All,

I'm using Blueprint 1.0.1 in JBoss AS 7.1.1 to deploy some services. I've notice that my bean shutdown methods as specified in the attribute "destroy-method" aren't being called. I'm seeing this trace in the console:

2.2.1
2012-08-30 14:43:57,949 ERROR [org.jboss.osgi.framework.internal.FrameworkEventsPlugin](MSC service thread 1-3) Framework ERROR: org.osgi.framework.BundleExcept
ion: Error during stop of bundle: org.eclipse.gemini.blueprint.extender:1.0.1.RELEASE
        at org.jboss.osgi.framework.internal.HostBundleState.stopInternal(HostBundleState.java:425)
        at org.jboss.osgi.framework.internal.BundleManager.uninstallBundle(BundleManager.java:446)
        at org.jboss.osgi.framework.internal.UserBundleInstalledService.stop(UserBundleInstalledService.java:88)
        at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911)
        at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
        at java.util.AbstractCollection.removeAll(AbstractCollection.java:336)
        at org.eclipse.gemini.blueprint.extender.internal.dependencies.shutdown.ShutdownSorter.getBundles(ShutdownSorter.java:65)
        at org.eclipse.gemini.blueprint.extender.internal.activator.LifecycleManager.destroy(LifecycleManager.java:353)
        at org.eclipse.gemini.blueprint.extender.internal.activator.ContextLoaderListener.shutdown(ContextLoaderListener.java:428)
        at org.eclipse.gemini.blueprint.extender.internal.activator.ContextLoaderListener.stop(ContextLoaderListener.java:397)
        at org.eclipse.gemini.blueprint.extender.internal.blueprint.activator.BlueprintLoaderListener.stop(BlueprintLoaderListener.java:57)
        at org.eclipse.gemini.blueprint.extender.internal.boot.ChainActivator.stop(ChainActivator.java:66)
        at org.jboss.osgi.framework.internal.HostBundleState.stopInternal(HostBundleState.java:394)
        ... 7 more



The NPE appears to be a secondary problem after an IllegalStateException is thrown in ShutdownSorter.unusedBundles. I did some debugging and it looks like the bundles it is trying to process are all in the state UNINSTALLED, so the IllegalStateException is to be expected.

The destroy-method works if I undeploy a bundle without stopping JBoss. The problem occurs when I do ctrl+c in the console. It is as though Felix is undeploying the bundles before Blueprint has a chance to do its stuff.

Is this correct behaviour?

Thanks,
Brad.
Re: Blueprint - destroy-method not being called [message #905546 is a reply to message #905499] Thu, 30 August 2012 15:46 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
The NPE is certainly not correct. I've fixed it in commit 0d4dd25afb3de213dc023b29a2f95f58e619fc85 which will appear in 1.0.2 (which I hope to produce tomorrow).
Re: Blueprint - destroy-method not being called [message #905556 is a reply to message #905546] Thu, 30 August 2012 16:12 Go to previous messageGo to next message
Brad - is currently offline Brad -Friend
Messages: 2
Registered: August 2012
Junior Member
Hi Glyn,

thanks for fix. I just tested against 1.0.2.BUILD-SNAPSHOT, that has moved things on to the IllegalStateException in unusedBundles:

2012-08-30 16:58:42,121 ERROR [org.jboss.osgi.framework.internal.FrameworkEventsPlugin](MSC service thread 1-4) Framework ERROR: org.osgi.framework.BundleExcept
ion: Error during stop of bundle: org.eclipse.gemini.blueprint.extender:1.0.2.BUILD-SNAPSHOT
        at org.jboss.osgi.framework.internal.HostBundleState.stopInternal(HostBundleState.java:425)
        at org.jboss.osgi.framework.internal.BundleManager.uninstallBundle(BundleManager.java:446)
        at org.jboss.osgi.framework.internal.UserBundleInstalledService.stop(UserBundleInstalledService.java:88)
        at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911)
        at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalStateException: Bundle uninstalled: my-test-svc:1.0.0.SNAPSHOT
        at org.jboss.osgi.framework.internal.AbstractBundleState.assertNotUninstalled(AbstractBundleState.java:577)
        at org.jboss.osgi.framework.internal.AbstractBundleState.getRegisteredServices(AbstractBundleState.java:211)
        at org.eclipse.gemini.blueprint.extender.internal.dependencies.shutdown.ShutdownSorter.unusedBundles(ShutdownSorter.java:81)
        at org.eclipse.gemini.blueprint.extender.internal.dependencies.shutdown.ShutdownSorter.getBundles(ShutdownSorter.java:57)
        at org.eclipse.gemini.blueprint.extender.internal.activator.LifecycleManager.destroy(LifecycleManager.java:353)
        at org.eclipse.gemini.blueprint.extender.internal.activator.ContextLoaderListener.shutdown(ContextLoaderListener.java:428)
        at org.eclipse.gemini.blueprint.extender.internal.activator.ContextLoaderListener.stop(ContextLoaderListener.java:397)
        at org.eclipse.gemini.blueprint.extender.internal.blueprint.activator.BlueprintLoaderListener.stop(BlueprintLoaderListener.java:57)
        at org.eclipse.gemini.blueprint.extender.internal.boot.ChainActivator.stop(ChainActivator.java:66)
        at org.jboss.osgi.framework.internal.HostBundleState.stopInternal(HostBundleState.java:394)
        ... 7 more


Re: Blueprint - destroy-method not being called [message #905857 is a reply to message #905556] Fri, 31 August 2012 08:00 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Thanks for that testing. I raised and fixed bug 388496.
Previous Topic:Gemini Web 2.2.0 M01 is now available
Next Topic:Gemini Blueprint 1.0.2.RELEASE
Goto Forum:
  


Current Time: Thu Apr 25 19:32:39 GMT 2024

Powered by FUDForum. Page generated in 0.03488 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top