Hi,

Can we please revert this fix (Rev. 679680, fix for 581), because it is _not_ the real fix ;-)

Registering the component as a SynchronousBundleListener does not help because nobody is interested in this ;-) Rather this interface is implemented such that the activate method can register the component as a bundle listener with the framework.

The real cause is another issue: In earlier releases of the Apache Felix SCR plugin the immediate attribute handling was wrong, in that the immediate attribute was always set to "true" if not specified with the @scr.component tag (actually the Apache Felix Declarative Service implementation also contained incorrect handling of this attribute).

This turns out to give a wrong default value in the case of a component providing a service: The standard says, that components providing services are delayed by default, while the maven SCR plugin turn them into immediate by default.

It seems, that the released bundle is now created with the new (fixed) SCR plugin, which does _not_ set the immediate attribute to any value if not set in the @scr.component tag. This causes the Declarative Services runtime to apply the correct default value algorithm (which is sort of quite convoleted) - making the component a delayed component.

Thus, the ObjectContentManagerFactoryImpl is registered as a delayed component and as a consequence the OcmAdapterFactory is not registered as an AdapterFactory and hence OCM was actually inactive ...

Setting the immediate attribute to true in the @scr.component tag (as of Rev. 66451, fixing issue 546) fixes the problem.

But: this fix did _not_ make it into the release.

And therefore, finally, just compiling and installing the current trunk just fixes the problem.

Hope this helps.

Regards
Felix

Carsten Ziegeler schrieb:
Craig L. Ching wrote

I think I figured this out: I added @scr.service interface="org.osgi.framework.SynchronousBundleListener" to ObjectContentManagerFactoryImpl, and the component now activates immediately (and registers mapped types from simple-demo)


Ok, I said in another thread that this didn't work for me, but I forgot
about the fact that the release bundle was installed by default, not my
built bundle.  I'll open a JIRA issue with a patch.

Thanks for finding this Rory!  Saved me a ton of time ;-)

Yes, thanks for the patch - I've applied it.
However, the service should have started as the immediate flag has been set to true.

Carsten

Reply via email to