jodconverter doesn't find soffice.bin

4.6k views Asked by At

I'm trying to use JODConverter on top of jetty and sinatra. Whenever I fire up my Jetty server, which has the sinatra application deployed to it in a war. i get this exception (much cruft removed):

java.lang.IllegalStateException: invalid officeHome: it doesn't contain soffice.bin:

in my settings.yml file I have the following:

secret: Whatever_you_want_it_to_be
PARAMETER_OFFICE_PORT: 8100
PARAMETER_OFFICE_HOME: /Volumes/OpenOffice.org 3.3/OpenOffice.org.app/Contents/MacOS
PARAMETER_OFFICE_PROFILE: /Applications/OpenOffice.org.app/Contents/MacOS

and here are the contents of those last two directories:

>ls '/Volumes/OpenOffice.org 3.3/OpenOffice.org.app/Contents/MacOS' 
about.png     crashrep      intro.png     sbase         sdraw         simpress      soffice       sofficerc     testtool      unopkg        urelibs
boot straprc   fundamentalrc resource      scalc         setuprc       smath         soffice.bin   swriter       unoinfo       unopkg.bin    versionrc

>ls /Applications/OpenOffice.org.app/Contents/MacOS                      
about.png     crashrep      intro.png     sbase         sdraw         simpress       soffice       sofficerc     testtool      unopkg        urelibs
bootstraprc   fundamentalrc resource      scalc         setuprc       smath          soffice.bin   swriter       unoinfo       unopkg.bin    versionrc

Notice that both ls's show "soffice.bin" in them

update:

I've also tried this:

> sudo chmod 777 '/Volumes/OpenOffice.org 3.3/OpenOffice.org.app/Contents/MacOS/soffice.bin'
Password:
chmod: Unable to change file mode on /Volumes/OpenOffice.org 3.3/OpenOffice.org.app/Contents/MacOS/soffice.bin: Read-only file system

I've also tried using the second directory for office_home and vice versa. no luck.

2

There are 2 answers

0
roughley On BEST ANSWER

Sounds like you're either missing a JAR file or there may be a conflict in the JAR files being used. Although it's not JRuby, this post should shed some light: http://groups.google.com/group/jodconverter/browse_thread/thread/cdf6600288bfba5a/8ed4558cfde08e39

0
Schorsch On

If anyone still has the same problem (as I did) the problem was, that the parameter OfficeHome for Mac has to specify the folder "Contents", not the folder "Contents/MacOs/".

The JODConverter is checking if the following exists:

new File(officeHome, "MacOS/soffice.bin")

So the OpenOffice home folder should have been /Applications/OpenOffice.org.app/Contents.