Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
scr-2.1.16
-
None
Description
org.apache.felix.scr.impl.manager.RegionConfigurationSupport holds the support in SCR for dealing with configurations for components. This class does not handle the various methods on org.osgi.service.cm.Configuration that can throw an IllegalStateException if the configuration is deleted, for example:
- org.osgi.service.cm.Configuration.getPid()
- org.osgi.service.cm.Configuration.getProperties()
- org.osgi.service.cm.Configuration.getProcessedProperties(ServiceReference<?>)
- org.osgi.service.cm.Configuration.getFactoryPid()
- org.osgi.service.cm.Configuration.getChangeCount()
- org.osgi.service.cm.Configuration.getAttributes()
This leaves SCR open to failing if the configuration has been deleted after SCR has gotten the configuration from ConfigurationAdmin but before SCR has been able to use the configuration to configure a component. Instead of having a catastrophic failure that bubbles the IllegalStateException up the stack, SCR should handle the exception and treat it as if the configuration was never found in the first place.