bootstrapconnector.jar / ooo.connector.BootstrapSocketConnector

Katarina Behrens Katarina.Behrens at cib.de
Fri May 6 08:35:27 UTC 2016


Hi Ivan & list, 

> I'm writing an application that uses LibreOffice API, however in order to
> connect to LibreOffice I've ended up using a certain JAR (originally
> published on OpenOffice forums) that allows to specify a path to
> LibreOffice binary named bootstrapconnector.jar.

I know which bootstrapconnector you mean. Certain Java library built over 
Libreoffice UNO API I accidentally ended up contributing to (noa-libre [1]) was 
using it as well. However I dropped it from there recently in favour of 
Libreoffice's own bootstrapping mechanism (see below). 

Maybe you can still dig the jar out of the depths of github and see if it's 
any better than the one from Maven central, but I'm pretty certain it was 
using this old-style CLI syntax with single dash as well and noa-libre was 
working around that in its own code somehow. 

Of course, I don't know what kind of application you are writing, but maybe 
you might want to have a look at noa-libre, if it matches your needs. It 
greatly simplifies the code when it comes to basic things such as bootstrapping 
and connecting to Libreoffice and it also has some pretty nice wrapper around 
UNO API for Writer functionality (some wrapper for Calc/Impress too, but those 
are in rather unfinished state *grin* )

> My question is -- does LibreOffice has it's own version of this module
> (perhaps included in some other package or named differently)? If not, then
> perhaps LibreOffice should have it as well?

Actually, nope. It's not that I'd know all the reasoning and history behind 
technical decisions made, but last time I asked, I was told that "The 
Libreoffice Way" to bootstrap UNO from Java code is to use the combination of:

* javaunohelper (juh.jar) bootstrap class (com.sun.star.comp.helper.Bootstrap) 
* and customized class loader (com.sun.star.lib.loader) from Libreoffice SDK

Since javaunohelper's bootstrapping mechanism doesn't allow to specify path to 
Libreoffice binary, one needs the customized classloader (the one from SDK is 
Java's URLClassLoader on LSD) that will then try to find UNO on the system in 
different places, looking at Java properties, environment variables, Windows 
registry and more.

HTH

[1] https://github.com/LibreOffice/noa-libre/
-- 

Katarina Behrens

Softwareentwicklerin LibreOffice
–––
CIB software GmbH
Geschäftsstelle Hamburg
Flachsland 10
22083 Hamburg
–––
T +49 (40) / 28 48 42 -235
F +49 (40) / 28 48 42 -100

Katarina.Behrens at cib.de
www.cib.de
–––
Sitz: München
Registergericht München, HRB 123286
Geschäftsführer: Dipl.-Ing. Ulrich Brandner


More information about the LibreOffice mailing list