{
XMultiServiceFactory xMultiServiceFactory = null;
XMultiServiceFactory xLocalServiceManager =
com.sun.star.comp.helper.Bootstrap.createSimpleServiceManager();
XUnoUrlResolver aURLResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(
XUnoUrlResolver.class,
xLocalServiceManager.createInstance( "com.sun.star.bridge.UnoUrlResolver" ) );
xMultiServiceFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(
XMultiServiceFactory.class,
aURLResolver.resolve( sConnection ) );
if ( xMultiServiceFactory == null )
throw new Exception( "couldn't not connect to:'" + sConnection + "'" );
return xMultiServiceFactory;
}