Hi Rob,
Am Donnerstag, den 07.02.2008, 14:17 -0800 schrieb rcohen16:
> Disclaimer: OSGi Newbie here.
Welcome and have fun !
> I am running Felix 1.0.3 and the Configuration Admin 1.0.0 (recently
> released). I have the following bundles:
>
> Bundle 1: Uses the FilePersistenceManager service to store some simple
> configuration for service.pid "myservice.piddy"
You should probably not use the FilePersistenceManager to create
configurations. At the configuration level you should consider this
service and implementation detail of the Felix Config Admin
implementation.
You should really create a configuration by
ConfigurationAdmin.getConfiguration(String pid) method, prepare
configuration properties and then call Configuration.update(Dictionary),
e.g.:
Configuration config =
configAdmin.getConfiguration("myservice.piddy");
Dictionary props = config.getProperties();
if (props == null) { // new configuration
props = new Hashtable();
}
// set some more properties
config.update(props);
That's all.
> Bundle 2: Registers a ManagedService with service.pid "myservice.piddy"
>
> I see that the configuration is indeed stored in
> <cache>/bundle#/data/config/myservice/piddy.config.
>
> TMK, the expected results are that when I start Bundle 2, the
> ManagedService's updated() method should get called and it should receive
> the configuration create by Bundle 1. What actually happens is that Bundle 2
> starts, but the updated() method does not get called and the Configuration
> Admin's UpdateThread throws the following exception:
>
>
> *ERROR* Unexpected problem executing task
> java.lang.NullPointerException
This exception may be the result of your manually created configuration
file not containing necessairy information, most notably the
service.pid. But as I said, directly manipulating of configuration data
is not intended..
Hope this helps.
Regards
Felix
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]