[
https://issues.apache.org/jira/browse/ARIES-957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16743365#comment-16743365
]
Kyle Stiemann edited comment on ARIES-957 at 1/15/19 8:14 PM:
--------------------------------------------------------------
I believe the only way to work around this issue is to add the following header
to {{ServiceLoader}} provider bundles:
{code}
Bundle-ActivationPolicy: lazy;includes="package.of.my.service.impl"
{code}
was (Author: stiemannkj1):
I believe the only way to work around this issue is to add the following header
to SPI service provider bundles:
{code}
Bundle-ActivationPolicy: lazy;includes="package.of.my.service.impl"
{code}
> SPIFly: Service Providers ignored if bundle is not active
> ---------------------------------------------------------
>
> Key: ARIES-957
> URL: https://issues.apache.org/jira/browse/ARIES-957
> Project: Aries
> Issue Type: Bug
> Affects Versions: 1.0
> Environment: o.a.a.spifly.dynamic.bundle - 1.0.0-SNAPSHOT
> Eclipse 4.2
> Reporter: Kevin Milburn
> Priority: Major
>
> Bundles which provide services (through SPI-Provides or Provide-Capability)
> are not processed unless the bundle is activated, requiring explicity
> activation rather than lazy activation.
> The providerBundleTracker in BaseActivator should track Installed, Resolved,
> Starting and Active bundles (same as the consumerBundleTracker).
> With the ProviderBundleTrackerCustomizer as it current works, calls to
> bundle.getBundleContext() may result in a null pointer if the bundle is not
> active.
> With Eclipse, a bundle with the Bundle-ActivationPolicy: lazy will become
> actived while processing the services (e.g. on bundle.loadClass()), resulting
> in a valid bundleContext. Bundles without this header will return null.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)