You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Clement Escoffier (JIRA)" <ji...@apache.org> on 2014/12/02 14:16:12 UTC

[jira] [Commented] (FELIX-4646) @Context(Context.Source.INSTANCE) does not inject bundle context

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

Clement Escoffier commented on FELIX-4646:
------------------------------------------

First, the @Configuration issue was fixed earlier Today (See FELIX-4715).

Then, when using the Factory service, iPOJO is not able to retrieve the caller bundle context, and so, you need to inject it manually in the instance configuration:

{code}
Properties configuration = new Properties();
configuration.put("instance.bundle.context", bc); // bc is the bundle context
ComponentInstance instance = ipojoHelper.createComponentInstance("my-component", configuration);
{code}

> @Context(Context.Source.INSTANCE) does not inject bundle context
> ----------------------------------------------------------------
>
>                 Key: FELIX-4646
>                 URL: https://issues.apache.org/jira/browse/FELIX-4646
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-runtime-1.12.0
>         Environment: JAVA 1.8
>            Reporter: Pierrick
>            Assignee: Clement Escoffier
>            Priority: Blocker
>
> I would like to use the bundle context for each instanciate of my bundle with this code :
> @Context(Context.Source.INSTANCE)
>     private BundleContext _context;
> But the context return is null.
> If I use Context.Source.COMPONENT for the context definition, the context field is injected.



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