XImplementationLoader xImpLoader = (XImplementationLoader)UnoRuntime.queryInterface(
XImplementationLoader.class, new JavaLoader() );
// Get the factory of the ServiceManager
XSingleComponentFactory smgr_fac = (XSingleComponentFactory)UnoRuntime.queryInterface(
XSingleComponentFactory.class, xImpLoader.activate(
"com.sun.star.comp.servicemanager.ServiceManager", null, null, null ) );
// Create an instance of the ServiceManager
XMultiComponentFactory xSMgr = (XMultiComponentFactory)UnoRuntime.queryInterface(
XMultiComponentFactory.class, smgr_fac.createInstanceWithContext( null ) );