code: protected Framework startFramework(BootstrapConfig config) throws BundleException {
          // Set the default startlevel of the framework. We want the framework to
          // start at our bootstrap level (i.e. Framework bundle itself will start, and
          // it will pre-load and re-start any previously known bundles in the
          // bootstrap start level).
          config.put(org.osgi.framework.Constants.FRAMEWORK_BEGINNING_STARTLEVEL,
                     Integer.toString(KernelStartLevel.OSGI_INIT.getLevel()));
  
          fwkClassloader = config.getFrameworkClassloader();
  
          FrameworkFactory fwkFactory = FrameworkConfigurator.getFrameworkFactory(fwkClassloader);
          // Initialize the framework to create a valid system bundle context
          // Start the shutdown monitor (before we start any bundles)
          // This exception will have a translated message stating that an unknown exception occurred.
          // This is so bizarre a case that it should never happen.
          try {
              Framework fwk = fwkFactory.newFramework(config.getFrameworkProperties());
              if (fwk == null)
                  return null;
              fwk.start();
              return fwk;
          } catch (BundleException ex) {
              throw ex;
          } catch (RuntimeException ex) {
              // Try to diagnose this exception. If it's something we know about, we will log an error and
              // return null here (which will result in a general "Failed to start the framework" error message
              // higher up.) Otherwise, just throw the exception
              if (!handleEquinoxRuntimeException(ex))
                  throw ex;
              return null;
          }
      }
docs: Create and start a new instance of an OSGi framework using the provided
  properties as framework properties.