FELIX-5040 getBundle by location for global extender

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1703652 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/Activator.java b/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
index 27b9874..3672442 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
@@ -115,7 +115,7 @@
         BundleContext context;
         if ( globalExtender )
         {
-            context = m_context.getBundle( 0 ).getBundleContext();
+            context = m_context.getBundle( Constants.SYSTEM_BUNDLE_LOCATION ).getBundleContext();
         }
         else
         {
@@ -238,10 +238,21 @@
 
     //---------- Component Management -----------------------------------------
 
+    private volatile boolean gogoMissing =true;
 
     @Override
     protected Extension doCreateExtension(final Bundle bundle) throws Exception
     {
+        if (gogoMissing)
+        {
+            try
+            {
+                bundle.loadClass("org.apache.felix.service.command.Descriptor");
+                gogoMissing = false;
+            }
+            catch (Throwable e)
+            {}
+        }
         return new ScrExtension(bundle);
     }