Archive for the ‘Open Office’ Category

OpenOffice BootstrapException NoConnectException with Invisible (Hidden/Headless) Mode with Linux

May 1, 2011 1 comment

I got this exception

while connecting to open office from another application (PhpBridge custom servlet in my case).

Here’s the original code i was using


Here how I got around it.

List<String> oooOptions = OOoServer.getDefaultOOoOptions();

The -headless & -nofirststartwizard are important. In linux, the “headless” package must be separately installed.

Next, do the following

OOoServer oooServer = new OOoServer(installationPath, oooOptions);
BootstrapSocketConnector bootstrapSocketConnector = new BootstrapSocketConnector(oooServer);
XComponentContext context = bootstrapSocketConnector.connect();

Once you have a componentContext, you’re all set and good to go!

Categories: Bootstrap, Open Office