Don't throw a ConfigurationException when the updated callback method does not exist.
Indeed, throwing a ConfigurationException cause a serious problem when adding a ConfigurationDependency in
in an aspect (or adapter) service, because the aspect (or adapter) internal service does not implement the updated callback.
Note: we take the same behavior as with ServiceDependency, which also ignores NoSuchMethodException when the callback method
for injected dependencies is not found in the service impl.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@947775 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
index 3a074a7..c6f37dd 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
@@ -227,6 +227,9 @@
throw new ConfigurationException(null, "Service " + ds + " with " + this.toString() + " could not be updated", e.getTargetException());
}
}
+ catch (NoSuchMethodException e) {
+ // if the method does not exist, ignore it
+ }
catch (Throwable t) {
// wrap any other exception as a ConfigurationException.
throw new ConfigurationException(null, "Service " + ds + " with " + this.toString() + " could not be updated", t);