You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Roland <wg...@ids.de> on 2013/09/03 12:42:53 UTC

Re: OSGI Configuration cannot take effect immediately

I often get problems with the ConfigurationAdmin and the
ManagedServiceFactory.

What does this error msg mean?
Cannot use configuration my.configuration.pid for
[org.osgi.service.cm.ManagedServiceFactory, id=54,
bundle=46/file:my/bundle1/location]: No visibility to configuration bound to
file:my/bundle2/location

I checked
  -the pid of configuration and MSF
  -the permissions of bundle1 and bundle2

How can I make the configuration visible to an other bundle?

Thanks and Regards





--
View this message in context: http://apache-felix.18485.x6.nabble.com/OSGI-Configuration-cannot-take-effect-immediately-tp4833849p5004793.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: OSGI Configuration cannot take effect immediately

Posted by Roland <wg...@ids.de>.
Great! That works! Thanks for your support!



--
View this message in context: http://apache-felix.18485.x6.nabble.com/OSGI-Configuration-cannot-take-effect-immediately-tp4833849p5004808.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: OSGI Configuration cannot take effect immediately

Posted by David Jencks <da...@yahoo.com>.
I don't think I understand many details of what you are trying to do… but….  it looks like you have two MSF/MS/configured DS component in different bundles that are using the same PID.  Without doing something, only the first will actually be able to use the configuration.  The first bundle to get the config will get the location set to its location, and other bundles won't be able to see the configuration.

If you really intend to share the configuration across several bundles, you need to use a recent CA and use region support.  For instance set the configuration location to "?" and all bundles will be able to use the same configuration.

hope this helps even though I don't understand what you are trying to do.
david jencks

On Sep 3, 2013, at 11:03 AM, Felix Meschberger <fm...@adobe.com> wrote:

> Hi
> 
> Am 03.09.2013 um 08:45 schrieb Roland:
> 
>> I can definitly say that I have a some kind of racecondition.
>> My bundle creates one configuration for a MSF bounded to the same location,
>> and also some configurations bounded to other locations. Only those
>> configuration is updated by the CA which was detected first. The sequence is
>> not predictable.
>> 
>> Thread 1
>> config = confAdmin.createFactoryConfiguration(factoryPIDintern);
>> config.update(properties0);
>> ...
>> 
>> Thread 2
>> config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
>> config.update(properties1);
>> ...
>> config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
>> config.update(properties2);
>> ...
>> config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
>> config.update(properties3);
>> ...
>> 
>> 
>> What I get is something like this:
>> "Cannot use configuration factoryPIDextern for
>> [org.osgi.service.cm.ManagedServiceFactory, id=52,
>> bundle=46/file:/externallocation]: No visibility to configuration bound to
>> file:/internallocation"
>> ...
> 
> It looks like a bundle whose location is "file:/internallocation" registered a ManagedServiceFactory which already got the factoryPIDextern configuration and thus this configuration is thus wired to that bundle.
> 
> Regards
> Felix
> 
>> 
>> My Permissions
>> (org.osgi.framework.ConfigurationPermission * configure)
>> (org.osgi.framework.AdminPermission * metadata)
>> 
>> What the spec. says:
>> "...The calls to the updated method of a ManagedServiceFactory must be
>> executed sequentially and not overlap in time. ..."
>> 
>> Am I right in thinking that I need to synchronize with the CA?
>> What else am I doing wrong?
>> 
>> Thanks & Regards
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-felix.18485.x6.nabble.com/OSGI-Configuration-cannot-take-effect-immediately-tp4833849p5004799.html
>> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: OSGI Configuration cannot take effect immediately

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Am 03.09.2013 um 08:45 schrieb Roland:

> I can definitly say that I have a some kind of racecondition.
> My bundle creates one configuration for a MSF bounded to the same location,
> and also some configurations bounded to other locations. Only those
> configuration is updated by the CA which was detected first. The sequence is
> not predictable.
> 
> Thread 1
> config = confAdmin.createFactoryConfiguration(factoryPIDintern);
> config.update(properties0);
> ...
> 
> Thread 2
> config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
> config.update(properties1);
> ...
> config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
> config.update(properties2);
> ...
> config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
> config.update(properties3);
> ...
> 
> 
> What I get is something like this:
> "Cannot use configuration factoryPIDextern for
> [org.osgi.service.cm.ManagedServiceFactory, id=52,
> bundle=46/file:/externallocation]: No visibility to configuration bound to
> file:/internallocation"
> ...

It looks like a bundle whose location is "file:/internallocation" registered a ManagedServiceFactory which already got the factoryPIDextern configuration and thus this configuration is thus wired to that bundle.

Regards
Felix

> 
> My Permissions
> (org.osgi.framework.ConfigurationPermission * configure)
> (org.osgi.framework.AdminPermission * metadata)
> 
> What the spec. says:
> "...The calls to the updated method of a ManagedServiceFactory must be
> executed sequentially and not overlap in time. ..."
> 
> Am I right in thinking that I need to synchronize with the CA?
> What else am I doing wrong?
> 
> Thanks & Regards
> 
> 
> 
> 
> --
> View this message in context: http://apache-felix.18485.x6.nabble.com/OSGI-Configuration-cannot-take-effect-immediately-tp4833849p5004799.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


Re: OSGI Configuration cannot take effect immediately

Posted by Roland <wg...@ids.de>.
I can definitly say that I have a some kind of racecondition.
My bundle creates one configuration for a MSF bounded to the same location,
and also some configurations bounded to other locations. Only those
configuration is updated by the CA which was detected first. The sequence is
not predictable.

Thread 1
config = confAdmin.createFactoryConfiguration(factoryPIDintern);
config.update(properties0);
...

Thread 2
config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
config.update(properties1);
...
config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
config.update(properties2);
...
config = confAdmin.createFactoryConfiguration(factoryPIDextern, null);
config.update(properties3);
...


What I get is something like this:
"Cannot use configuration factoryPIDextern for
[org.osgi.service.cm.ManagedServiceFactory, id=52,
bundle=46/file:/externallocation]: No visibility to configuration bound to
file:/internallocation"
...

My Permissions
(org.osgi.framework.ConfigurationPermission * configure)
(org.osgi.framework.AdminPermission * metadata)

What the spec. says:
"...The calls to the updated method of a ManagedServiceFactory must be
executed sequentially and not overlap in time. ..."

Am I right in thinking that I need to synchronize with the CA?
What else am I doing wrong?

Thanks & Regards




--
View this message in context: http://apache-felix.18485.x6.nabble.com/OSGI-Configuration-cannot-take-effect-immediately-tp4833849p5004799.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: OSGI Configuration cannot take effect immediately

Posted by Roland <wg...@ids.de>.
my fault. I have to set the location to null. Sorry for stealing your time.



--
View this message in context: http://apache-felix.18485.x6.nabble.com/OSGI-Configuration-cannot-take-effect-immediately-tp4833849p5004798.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org