diff --git a/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java b/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
index 36bd41f..6ab57b6 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
@@ -113,13 +113,20 @@
         // keep me informed on ConfigurationAdmin state changes
         try
         {
-            context.addServiceListener( this, "(objectclass=" + CONFIGURATION_ADMIN + ")" );
+            context.addServiceListener(this, "(objectclass=" + CONFIGURATION_ADMIN + ")");
         }
-        catch ( InvalidSyntaxException ise )
+        catch (InvalidSyntaxException ise)
         {
             // not expected (filter is tested valid)
         }
 
+        // If the Configuration Admin Service is already registered, setup
+        // configuration support immediately
+        if (context.getServiceReference(CONFIGURATION_ADMIN) != null)
+        {
+            getOrCreateConfigurationSupport();
+        }
+
         // register as ScrService
         Dictionary props = new Hashtable();
         props.put( Constants.SERVICE_DESCRIPTION, "Declarative Services Management Agent" );
@@ -448,7 +455,7 @@
     {
         if (event.getType() == ServiceEvent.REGISTERED)
         {
-            this.configurationSupport = new ConfigurationSupport(this.m_bundleContext, this);
+            ConfigurationSupport configurationSupport = getOrCreateConfigurationSupport();
 
             final ServiceReference caRef = event.getServiceReference();
             final Object service = m_bundleContext.getService(caRef);
@@ -456,7 +463,7 @@
             {
                 try
                 {
-                    this.configurationSupport.configureComponentHolders(caRef, service);
+                    configurationSupport.configureComponentHolders(caRef, service);
                 }
                 finally
                 {
@@ -466,11 +473,7 @@
         }
         else if (event.getType() == ServiceEvent.UNREGISTERING)
         {
-            if (configurationSupport != null)
-            {
-                this.configurationSupport.dispose();
-                this.configurationSupport = null;
-            }
+            disposeConfigurationSupport();
         }
     }
 
@@ -517,4 +520,22 @@
         // fall back: bundle is not considered active
         return false;
     }
+
+    private ConfigurationSupport getOrCreateConfigurationSupport()
+    {
+        if (configurationSupport == null)
+        {
+            configurationSupport = new ConfigurationSupport(m_bundleContext, this);
+        }
+        return configurationSupport;
+    }
+
+    private void disposeConfigurationSupport()
+    {
+        if (configurationSupport != null)
+        {
+            this.configurationSupport.dispose();
+            this.configurationSupport = null;
+        }
+    }
 }
