JODConverter failing to start libreoffice-3.4.5 - Freebsd 8.2

3,156 views
Skip to first unread message

unite07

unread,
Mar 6, 2012, 10:51:52 PM3/6/12
to JODConverter
I am getting an error when running the following comand:

java -Doffice.home=/usr/local/lib/libreoffice -jar jodconverter-
core-3.0-beta-4.jar test.xls test.pdf

I can make it work by starting libreoffice manually:

soffice --headless --accept="socket,host=127.0.0.1,port=2002;urp;"

This is the error:

Caused by: org.artofsolving.jodconverter.office.OfficeException: could
not establish connection
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:
142)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.access
$000(ManagedOfficeProcess.java:31)
at org.artofsolving.jodconverter.office.ManagedOfficeProcess
$1.run(ManagedOfficeProcess.java:58)
at java.util.concurrent.Executors
$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.artofsolving.jodconverter.office.OfficeException:
office process died with exit code 1
at org.artofsolving.jodconverter.office.ManagedOfficeProcess
$6.attempt(ManagedOfficeProcess.java:136)
at
org.artofsolving.jodconverter.office.Retryable.execute(Retryable.java:
40)
at
org.artofsolving.jodconverter.office.Retryable.execute(Retryable.java:
30)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:
120)


I think there is a bug?




hadv

unread,
Mar 7, 2012, 4:30:18 AM3/7/12
to JODConverter
I can still run on my side with below command with LibreOffice 3.4.4 -
Ubuntu 11.10

java -Doffice.home=/usr/lib/libreoffice -jar jodconverter-3.0-
beta-4.jar test.xls test.pdf

Richard Gathogo

unread,
Mar 7, 2012, 7:45:36 AM3/7/12
to jodcon...@googlegroups.com
Hi,
How did you install libreoffice?
If you downloaded, then installed you could try this depending on your version: libreoffice3.4 "--accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" --nologo --headless.
Regards Richard Gathogo.
Love covers a multitude of sins.



--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To post to this group, send email to jodcon...@googlegroups.com.
To unsubscribe from this group, send email to jodconverter...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jodconverter?hl=en.


unite07

unread,
Mar 7, 2012, 6:07:39 PM3/7/12
to JODConverter
I installed libreoffice-3.4.5 from the ports tree.

I have tried looking through the jdoconverter source code to see if
anything jumps out at me.

I don't think this command (java -Doffice.home=/usr/local/lib/
libreoffice -jar jodconverter-
core-3.0-beta-4.jar test.xls test.pdf) is using the correct path or
knows where the libreoffice bin lives.

In the mean time I am just starting libreoffice manually and am
working on using monit to keep it running.



On Mar 7, 4:45 am, Richard Gathogo <muraguri2...@gmail.com> wrote:
> Hi,
> How did you install libreoffice?
> If you downloaded, then installed you could try this depending on your
> version: *libreoffice3.4
> "--accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"
> --nologo --headless.*
> Regards Richard Gathogo.
>
> *Love covers a multitude of sins.*

unite07

unread,
Mar 7, 2012, 6:08:25 PM3/7/12
to JODConverter
I installed libreoffice-3.4.5 from the ports tree.

I have tried looking through the jdoconverter source code to see if
anything jumps out at me.

I don't think this command (java -Doffice.home=/usr/local/lib/
libreoffice -jar jodconverter-
core-3.0-beta-4.jar test.xls test.pdf) is using the correct path or
knows where the libreoffice bin lives.

In the mean time I am just starting libreoffice manually and am
working on using monit to keep it running.



On Mar 7, 4:45 am, Richard Gathogo <muraguri2...@gmail.com> wrote:
> Hi,
> How did you install libreoffice?
> If you downloaded, then installed you could try this depending on your
> version: *libreoffice3.4
> "--accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"
> --nologo --headless.*
> Regards Richard Gathogo.
>
> *Love covers a multitude of sins.*
>
>
>
>
>
>
>

hadv

unread,
Mar 7, 2012, 10:47:45 PM3/7/12
to JODConverter
Yep, maybe the -Doffice.home did not work!
I see in the source code of jodconveter, it will find the office in
below paths
Linux
"/opt/openoffice.org3"
"/opt/libreoffice"
"/usr/lib/openoffice"
"/usr/lib/libreoffice"

Windows:
"<SYSTEM_PROGRAMFILES>/OpenOffice.org 3"
"<SYSTEM_PROGRAMFILES>/LibreOffice 3"

Mac:
"/Applications/OpenOffice.org.app/Contents"
"/Applications/LibreOffice.app/Contents"

So if the office home was not located in those path, we have to start
office service manually as your case!

Bob

unread,
Mar 13, 2012, 11:41:08 AM3/13/12
to JODConverter
This version of libreoffice started being much more picky about
command line parameters. Specifically the -nocrashreport arg causes
the failure. Comment out OfficeProcess.java:91 to fix it. Also the -
env parameter seems to be no longer used and all of the parameters
should be -- instead of -. This is my diff from svn (ignore the
killExisting method)


Index: OfficeProcess.java
===================================================================
--- OfficeProcess.java (revision 220)
+++ OfficeProcess.java (working copy)
@@ -60,6 +60,14 @@
start(false);
}

+ public void killExisting() throws IOException {
+ ProcessQuery processQuery = new ProcessQuery("soffice.bin",
unoUrl.getAcceptString());
+ long existingPid = processManager.findPid(processQuery);
+ if (existingPid != PID_UNKNOWN) {
+ processManager.kill(process, existingPid);
+ }
+ }
+
public void start(boolean restart) throws IOException {
ProcessQuery processQuery = new ProcessQuery("soffice.bin",
unoUrl.getAcceptString());
long existingPid = processManager.findPid(processQuery);
@@ -76,15 +84,15 @@
command.addAll(Arrays.asList(runAsArgs));
}
command.add(executable.getAbsolutePath());
- command.add("-accept=" + unoUrl.getAcceptString() + ";urp;");
+ command.add("--accept=" + unoUrl.getAcceptString() +
";urp;");
command.add("-env:UserInstallation=" +
OfficeUtils.toUrl(instanceProfileDir));
- command.add("-headless");
- command.add("-nocrashreport");
- command.add("-nodefault");
- command.add("-nofirststartwizard");
- command.add("-nolockcheck");
- command.add("-nologo");
- command.add("-norestore");
+ command.add("--headless");
+ //command.add("--nocrashreport");
+ command.add("--nodefault");
+ command.add("--nofirststartwizard");
+ command.add("--nolockcheck");
+ command.add("--nologo");
+ command.add("--norestore");
ProcessBuilder processBuilder = new ProcessBuilder(command);
if (PlatformUtils.isWindows()) {
addBasisAndUrePaths(processBuilder);
Reply all
Reply to author
Forward
0 new messages