Home > Bootstrap, Open Office > OpenOffice BootstrapException NoConnectException with Invisible (Hidden/Headless) Mode with Linux

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

I got this exception

 com.sun.star.comp.helper.BootstrapException: com.sun.star.connection.NoConnectException

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

Here’s the original code i was using

BootstrapSocketConnector.bootstrap(installationPath);

Here how I got around it.

List<String> oooOptions = OOoServer.getDefaultOOoOptions();
oooOptions.add(“-headless”);
oooOptions.add(“-nofirststartwizard”);

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!

Advertisements
Categories: Bootstrap, Open Office
  1. May 2, 2014 at 2:49 am

    Thank you for the good writeup. It in fact was a amusement
    account it. Look advanced to far added agreeable from you!

    By the way, how can we communicate?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: