aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alasdair Nottingham (Resolved) (JIRA)" <>
Subject [jira] [Resolved] (ARIES-829) ReferenceListRecepie releases using the wrong BundleContext
Date Tue, 14 Feb 2012 19:33:59 GMT


Alasdair Nottingham resolved ARIES-829.

    Resolution: Fixed
> ReferenceListRecepie releases using the wrong BundleContext
> -----------------------------------------------------------
>                 Key: ARIES-829
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: blueprint-0.3.1
>            Reporter: Alasdair Nottingham
>            Assignee: Alasdair Nottingham
> Looking at ARIES-828 logs I spotted an IllegalStateException in ReferenceListRecipe.ServiceDispatcher.destory
on the following line:
> ctx.ungetService(ref);
> so of course I looked and thought, ah we should just catch the IllegalStateException
and move on, we get that if the service doesn't exist anymore, so who cares. Then I spotted
the context. It does this:
>                 Bundle bundle = ref.getBundle();
>                 if (bundle != null) {
>                     BundleContext ctx = bundle.getBundleContext();
>                     if (ctx != null) {
>                           ctx.ungetService(ref);
>                     }
>                 }
> This means we are using the bundle context of the bundle that registered the service
to unget it. The code where we do a lookup says this:
> getBundleContextForServiceLookup().getService(reference);
> which returns in the general case the BundleContext for the BlueprintContainer. So we
get using the bundle context of the blueprint bundle that uses the service, and unget using
the bundle context of the bundle providing the service. I know I'm having a bad day but my
eyes sprung out on stalks when I saw this.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message