public void doLaunch() {
        // Create a case-insensitive configuration property map.
        StringMap configMap = new StringMap();
        // Configure the Felix instance to be embedded.
        // configMap.put(FelixConstants.EMBEDDED_EXECUTION_PROP, "true");
        // Add core OSGi packages to be exported from the class path
        // via the system bundle.
        configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES, "org.osgi.framework; version=1.3.0," + "org.osgi.service.packageadmin; version=1.2.0,"
                        + "org.osgi.service.startlevel; version=1.0.0," + "org.osgi.service.url; version=1.0.0");

        configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);

        // Explicitly specify the directory to use for caching bundles.
        // configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP, "cache");

        try {
            // Create host activator;

            List<Object> list = new ArrayList<>();

            // list.add(new HostActivator());
            configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, "org.xml.sax, org.xml.sax.helpers, javax.xml.parsers, javax.naming");
            configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
            configMap.put("felix.log.level", "4");

            // Now create an instance of the framework with
            // our configuration properties and activator.
            felix = new Felix(configMap);
            felix.init();

            // otherProps.put(Constants.FRAMEWORK_STORAGE, "bundles");

            otherProps.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERTY, AutoProcessor.AUTO_DEPLOY_DIR_VALUE);
            otherProps.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERTY, AutoProcessor.AUTO_DEPLOY_START_VALUE + "," + AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);

            BundleContext felixBudleContext = felix.getBundleContext();

            AutoProcessor.process(otherProps, felixBudleContext);
            // listen to errors
            felixBudleContext.addFrameworkListener(frameworkErrorListener);
            felixBudleContext.addBundleListener(myBundleListener);
            // Now start Felix instance.
            felix.start();
            System.out.println("felix started");

        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
Runs a hosted version of Felix for testing purposes. Any bundle errors are
reported via the FrameworkListener passed to the constructor.

@author Ceki G&uuml;lc&uuml;
integration/src/test/java/org/slf4j/test_osgi/FelixHost.java