Can i make the webconsole react to Config Admin Service ConfigurationException?
Hello First of, let me say that this is my first time using the Config Admin Service, so if i have just completely misunderstood something, please do tell. I have created a bundle that uses the Configuration Admin and MetaType services to handle the configuration. Inside the updated(Dictionary) method in my bundle, i have made a few checks that throws a ConfigurationException if they fail (Files actualy existing, URLs being well-formed and whatnot). I would assume that when the updated(Dictionary) method throws one of these exceptions, that they actually be reflected in the WebConsole, but this does not seem to occur. When i enter a "bad" value for the bundle in the OSGi->Configuration window of the web console, the karaf.log sure enough shows. 2015-09-07 10:44:30,412 | ERROR | d=TestConsumer1) | configadmin | 3 - org.apache.felix.configadmin - 1.8.4 | [org.osgi.service.cm.ManagedService, id=154, bundle=93/mvn:com.netdesign.common/managedproperties/0.2-SNAPSHOT]: Updating property URLProperty of configuration TestConsumer1 caused a problem: Could not load properties. Could not filter value. org.osgi.service.cm.ConfigurationException: URLProperty : Could not load properties. Could not filter value. at dk.netdesign.common.osgi.config.ManagedProperties.filterObject(ManagedProperties.java:341)[93:ManagedPropertiesService:0.2.0.SNAPSHOT] at dk.netdesign.common.osgi.config.ManagedProperties.updated(ManagedProperties.java:222)[93:ManagedPropertiesService:0.2.0.SNAPSHOT] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.4] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.4] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.4] at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1747)[3:org.apache.felix.configadmin:1.8.4] at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)[3:org.apache.felix.configadmin:1.8.4] at java.lang.Thread.run(Thread.java:744)[:1.8.0] But there is reaction to this exception in the WebConsole. Furthermore, the "bad" value is still written in the field when i open the configuration window again, even though it was not added to the bundles configuration(I checked). Is there something more i need to do in order to make the WebConsole aware that an error occured with the configuration? Preferably i would like that the WebConsole returned at least the message of the ConfigurationException, and did not save bad values. Right now i see one value when i open the configuration window, and another value when i inspect the bundles configuration. Thanks in advance -Martin
Re: How to 'let the dust settle' with DS?
The whole thing works with 1.8.2; I look forward to some cleanup with 2.0, and I thank you all again for all the help. - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re: How to 'let the dust settle' with DS?
If the reference is static greedy, then the component having the reference has to be deactivated/reactivated each time the set of available services changes. If the component exposes a service, and is not immediate, then each get/unget cycle will result in activating/deactivating the instance. You need to include a lot more information about exactly what your components look like and the circumstances around the behavior you report to assign a specific cause to it. thanks david jencks > On Sep 8, 2015, at 1:23 PM, Benson Margulieswrote: > > JB says he'll have Karaf up to date next week. In the mean time, I've > onto the second chunk of blueprint that I wanted to fix. > > This time, all in one bundle, I have one multiple @Reference, and a > bundle of services that want to feed into it. > > I observe that an object is created, activate is called, and then > deactivate is called. > Then a new object is created, and the @Reference method gets called > before activate is called. > > Can you help me find the place in the spec that explains this lifecycle? > > - > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org > For additional commands, e-mail: users-h...@felix.apache.org > - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re: How to 'let the dust settle' with DS?
On Tue, Sep 8, 2015 at 1:47 PM, David Jenckswrote: > If the reference is static greedy, then the component having the reference > has to be deactivated/reactivated each time the set of available services > changes. > > If the component exposes a service, and is not immediate, then each get/unget > cycle will result in activating/deactivating the instance. > > You need to include a lot more information about exactly what your components > look like and the circumstances around the behavior you report to assign a > specific cause to it. OK, I've got it; that's exactly the situation at hand (static greedy). That works for me for now until I can use the newer version. > > thanks > david jencks > >> On Sep 8, 2015, at 1:23 PM, Benson Margulies wrote: >> >> JB says he'll have Karaf up to date next week. In the mean time, I've >> onto the second chunk of blueprint that I wanted to fix. >> >> This time, all in one bundle, I have one multiple @Reference, and a >> bundle of services that want to feed into it. >> >> I observe that an object is created, activate is called, and then >> deactivate is called. >> Then a new object is created, and the @Reference method gets called >> before activate is called. >> >> Can you help me find the place in the spec that explains this lifecycle? >> >> - >> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org >> For additional commands, e-mail: users-h...@felix.apache.org >> > > > - > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org > For additional commands, e-mail: users-h...@felix.apache.org > - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re: How to 'let the dust settle' with DS?
JB says he'll have Karaf up to date next week. In the mean time, I've onto the second chunk of blueprint that I wanted to fix. This time, all in one bundle, I have one multiple @Reference, and a bundle of services that want to feed into it. I observe that an object is created, activate is called, and then deactivate is called. Then a new object is created, and the @Reference method gets called before activate is called. Can you help me find the place in the spec that explains this lifecycle? - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org