[Solved] Bootstrapping on Ubuntu server
Posted: Sun Jan 29, 2017 4:32 pm
I operate a cloud server with Ubuntu 16.04 and OpenOffice 4.1.2. Several users use java application that bootstrap an instance of OpenOffice. For bootstrapping I use bootstrapconnector.jar. The first user can easily bootstrap OpenOffice with the following java-snippet:
OpenOffice starts and everything works just fine. But now a second user starts a different java application with nearly the same bootstrap-mechanism. Only loadUrl and the red line above are different. It reads now
The app of the second user crashes on the last line of the code snippet. In some cases with an error message, in other cases the OOo Document appears on the display of the first user!! But on the other hand, if user 1 types
on the terminal. OOo opens fine
Now user 2 typeson the terminal. OOo opens fine too.
sudo netstat -a gives me the information that ports 8699 and 8700 are in listening mode.
Some advice would be highly appreciated
Best regards and thanks in advance
Andeas from wmpartner
Code: Select all
List liste = ooo.connector.server.OOoServer.getDefaultOOoOptions();
liste.clear();
//liste.add("-nologo");
liste.add("--nodefault");
liste.add("--norestore");
oooExeFolder = "/opt/openoffice4/program";
ooo.connector.server.OOoServer server = new ooo.connector.server.OOoServer(oooExeFolder, liste);
[color=#800000]server.start("-accept=\"socket,host=localhost,port=8699;urp;StarOffice.ServiceManager\"");[/color]
System.out.println(server.toString());
BootstrapSocketConnector oooConnector = new BootstrapSocketConnector(server);
xContext = oooConnector.connect();
xMultiComponentFactory = xContext.getServiceManager();
xcomponentloader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class,xMultiComponentFactory.createInstanceWithContext("com.sun.star.frame.Desktop", xContext));
PropertyValue[] argumente = new PropertyValue[1];
argumente[0] = new PropertyValue();
argumente[0].Name="MacroExecutionMode";
argumente[0].Value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN;
objectDocumentToStore = (XComponent) xcomponentloader.loadComponentFromURL(loadUrl, "_default", 2, argumente);
Code: Select all
server.start("-accept=\"socket,host=localhost,port=8700;urp;StarOffice.ServiceManager\"");
Code: Select all
/opt/openoffice4/program/soffice -accept="socket,host=localhost,port=8699;urp;StarOffice.ServiceManager"
Now user 2 types
Code: Select all
/opt/openoffice4/program/soffice -accept="socket,host=localhost,port=8700;urp;StarOffice.ServiceManager"
sudo netstat -a gives me the information that ports 8699 and 8700 are in listening mode.
Some advice would be highly appreciated
Best regards and thanks in advance
Andeas from wmpartner