if (UtilValidate.isEmpty(host)) host = UtilProperties.getPropertyValue("openoffice-uno", "oo.host", "localhost");
if (UtilValidate.isEmpty(port)) port = UtilProperties.getPropertyValue("openoffice-uno", "oo.port", "8100");
XMultiComponentFactory xmulticomponentfactory = null;
XComponentContext xcomponentcontext = null;
Object objectUrlResolver = null;
XUnoUrlResolver xurlresolver = null;
Object objectInitial = null;
// Converting the document to the favoured type
try {
/* Bootstraps a component context with the jurt base components
registered. Component context to be granted to a component for running.
Arbitrary values can be retrieved from the context. */
xcomponentcontext = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);
/* Gets the service manager instance to be used (or null). This method has
been added for convenience, because the service manager is a often used
object. */
xmulticomponentfactory = xcomponentcontext.getServiceManager();
/* Creates an instance of the component UnoUrlResolver which
supports the services specified by the factory. */
objectUrlResolver = xmulticomponentfactory.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", xcomponentcontext);