[
https://issues.apache.org/jira/browse/CELIX-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14233120#comment-14233120
]
Alexander Broekhuis commented on CELIX-191:
-------------------------------------------
Thanks for the patch, but I think the proper way to solve this is to set a
bundle to "STOPPED" if it cannot be started. The spec says: "If the
start(BundleContext) method throws an exception, the Framework must mark the
bundle as stopped and send out STOPPING and STOPPED events but it must not call
the Bundle Activator stop(BundleContext) method. The start method must
therefore be careful to clean up any resources it creates in the start method
when it throws an exception."
So yeah, I do see the problem, and this needs to be fixed, but the current
state transitions follow the OSGi spec, although error handling is not done
properly. So instead of changing the order of the states, the startBundle
function needs to be updated to correctly mark a bundle as stopped and clean up
resources when an error is raised.
> Framework get stuck while stopping a bundle in STARTING state
> -------------------------------------------------------------
>
> Key: CELIX-191
> URL: https://issues.apache.org/jira/browse/CELIX-191
> Project: Celix
> Issue Type: Bug
> Reporter: Gabriele Ricciardi
> Attachments: framework_starting_bundle.patch
>
>
> In case there is a bundle in "STARTING" state (e.g. because the
> bundleActivator_create is successful but the bundleActivator_start fails for
> some reason) and the framework stop (i.e. stop 0) is called, the whole
> framework enters in a tight loop and gets stuck reporting a bundle exception.
> Find attached a patch file
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)