我正在尝试在jetty和sinatra上使用JODConverter。每当我启动Jetty服务器时,它都会在war中部署sinatra应用程序。我得到了这个异常(去掉了很多麻烦):
java.lang.IllegalStateException: invalid officeHome: it doesn't contain soffice.bin:在我的settings.yml文件中,我有以下内容:
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下面是最后两个目录的内容:
>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请注意,这两个ls中都显示了"soffice.bin“
更新:
我也尝试过这个:
> 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我还尝试对office_home使用第二个目录,反之亦然。不走运。
发布于 2011-11-04 10:56:52
听起来您可能缺少JAR文件,或者正在使用的JAR文件中可能存在冲突。虽然这不是JRuby,但这篇文章应该会带来一些启发:http://groups.google.com/group/jodconverter/browse_thread/thread/cdf6600288bfba5a/8ed4558cfde08e39
发布于 2014-01-20 23:18:31
如果有人仍然有同样的问题(和我一样),问题是Mac的参数OfficeHome必须指定文件夹"Contents",而不是文件夹"Contents/MacOs/“。
JODConverter正在检查是否存在以下内容:
new File(officeHome, "MacOS/soffice.bin")因此,OpenOffice主文件夹应为/Applications/OpenOffice.org.app/Contents.
https://stackoverflow.com/questions/8001226
复制相似问题