bundleContext = runMethod.invoke( null, new Object[]{null, null} );
bundleContext = runMethod.invoke( null, new Object[]{new String[]{}, null} );
	public void startup( PlatformConfig config ) throws BirtException	{		if ( frameworkClassLoader != null )		{			logger.log( Level.WARNING, "Framework is already started" ); //$NON-NLS-1$			return;		}				platformConfig = config;		IPlatformContext context = config.getPlatformContext( );		if ( context == null )		{			throw new BirtException(					PluginId,					"PlatformContext is not setted - {0}", new Object[]{"PlatformConfig"} ); //$NON-NLS-1$		}		// process install.area		String root = context.getPlatform( );		platformDirectory = new File( root );		if ( !platformDirectory.exists( ) || !platformDirectory.isDirectory( ) )		{			throw new BirtException( PluginId,					"Could not start the Framework - {0}" + root, root ); //$NON-NLS-1$		}		String path = new File( platformDirectory, "plugins" ).toString( ); //$NON-NLS-1$		path = searchFor( "org.eclipse.osgi", path ); //$NON-NLS-1$		if ( path == null )		{			throw new BirtException(					PluginId,					"Could not find the Framework - {0}", new Object[]{"org.eclipse.osgi"} ); //$NON-NLS-1$		}		try		{			osgiFramework = new File( path ).toURL( );		}		catch(MalformedURLException ex)		{			//cannot be here		}				ClassLoader original = Thread.currentThread( ).getContextClassLoader( );		try		{			ClassLoader loader = this.getClass( ).getClassLoader( );			frameworkClassLoader = new URLClassLoader( new URL[]{osgiFramework},					loader );			// frameworkClassLoader = new OSGIClassLoader(			// new URL[]{frameworkUrl}, loader );			// Weblogic 8.1SP6 contains old version JS.JAR, we need			// set pref-web-inf to true, if we set it to true, the			// URL classloader still loads the JS in weblogic, so			// load the class explicitly.			try			{				loader.loadClass( "org.mozilla.javascript.Context" );				loader.loadClass( "org.mozilla.javascript.Scriptable" );				loader.loadClass( "org.mozilla.javascript.ScriptableObject" );				// frameworkClassLoader.loadClass(				// "org.mozilla.javascript.Context"			}			catch ( Exception ex )			{			}			Class clazz = frameworkClassLoader.loadClass( ECLIPSE_STARTER );			setupOSGiProperties();			Method initPropertiesMethod = clazz.getMethod(					"setInitialProperties", new Class[]{Map.class} ); //$NON-NLS-1$						if ( initPropertiesMethod != null )			{				System.setProperty(						"osgi.framework.useSystemProperties", "false" ); //$NON-NLS-1$ //$NON-NLS-2$				properties.put( "osgi.framework.useSystemProperties", "false" );				initPropertiesMethod.invoke( null, new Object[]{properties} );			}			else			{				Iterator iter = properties.entrySet( ).iterator( );				while ( iter.hasNext( ) )				{					Map.Entry entry = (Map.Entry) iter.next( );					String key = (String) entry.getKey( );					String value = (String) entry.getValue( );					System.setProperty( key, value );				}				System.setProperty(						"osgi.framework.useSystemProperties", "true" ); //$NON-NLS-1$ //$NON-NLS-2$			}			Method runMethod = clazz.getMethod(					"startup", new Class[]{String[].class, Runnable.class} ); //$NON-NLS-1$			bundleContext = runMethod.invoke( null, new Object[]{null, null} );			frameworkContextClassLoader = Thread.currentThread( )					.getContextClassLoader( );		}		catch ( Exception e )		{			e.printStackTrace( );			return;		}		finally		{			Thread.currentThread( ).setContextClassLoader( original );		}	}