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