I say, this is a really good solution.
I made it work right on windows 7, however, I can't make it work at all on my new Ubuntu
first, I can't install "OpenOffice", it only lets me install the new LibreOffice, which suposedly should work
as it is OpenOffice-based.
It have all those jars too, but I can't figure the right files
After looking a lot on my System, I found a "soffice.sh" on "/etc/libreoffice"
Trying putting this as String for the bootstrap, but it gets me a "BootstrapException"
any ideas how can I make this work? thanks in advance
edit:
here's the stack trace... not very helpful
Code: Select all
at ooo.connector.BootstrapConnector.connect(BootstrapConnector.java:129)
at ooo.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.java:68)
at ooo.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.java:45)
at ooo.connector.BootstrapSocketConnector.bootstrap(BootstrapSocketConnector.java:82)
at br.com.virou.contas.Recibo.getRemoteServiceManager(Recibo.java:235)
Code: Select all
private XMultiComponentFactory getRemoteServiceManager()
throws java.lang.Exception
{
if (mxRemoteContext == null && mxRemoteServiceManager == null) {
// get the remote office context. If necessary a new office
// process is started
String oooExeFolder = "/etc/libreoffice";
//"C:/Program Files (x86)/OpenOffice.org 3/program";
mxRemoteContext = BootstrapSocketConnector.bootstrap(oooExeFolder); //Here is the Exception
System.out.println("Connected to a running office ...");
mxRemoteServiceManager = mxRemoteContext.getServiceManager();
Object oDesktop = mxRemoteServiceManager.createInstanceWithContext
("com.sun.star.frame.Desktop", mxRemoteContext);
xDesk = (com.sun.star.frame.XDesktop) UnoRuntime.queryInterface(
com.sun.star.frame.XDesktop.class, oDesktop);
}
return mxRemoteServiceManager;
}
LibreOffice 3.3.3
OOO330m19 (Build:301)
tag libreoffice-3.3.3.1, Ubuntu package 1:3.3.3-1ubuntu2