【问题标题】:Jodconverter on CentOS 6 - "failed to start and connect"CentOS 6 上的 Jodconverter - “无法启动和连接”
【发布时间】:2012-06-15 15:55:35
【问题描述】:

我正在尝试在 CentOS 6.2 服务器上设置 jodconverter-beta-4,但经过几天的尝试,我无法超越目前的状态。我不是 *nix 的巫师,所以如果我犯了一些新手错误,请多多包涵。

我使用添加/删除软件为 OpenOffice.org 安装的组件是:

  • 核心品牌
  • 核心模块
  • Calc、Draw、Impress、Math、Writer
  • 电子表格、绘图、演示文稿、方程式、文字处理器库
  • 额外的图形过滤器
  • UNO

我在 /opt/ 中创建了一个符号链接

ln -s /usr/lib64/openoffice.org3/ openoffice.org3

当我执行时:

java -jar jodconverter-core-3.0-beta-4.jar test.docx test.pdf

我得到以下信息:

    Jun 12, 2012 10:56:40 a.m. org.artofsolving.jodconverter.office.ProcessPoolOfficeManager <init>
INFO: ProcessManager implementation is LinuxProcessManager
Exception in thread "main" org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:64)
   at org.artofsolving.jodconverter.office.PooledOfficeManager.start(PooledOfficeManager.java:101)
   at org.artofsolving.jodconverter.office.ProcessPoolOfficeManager.start(ProcessPoolOfficeManager.java:62)
   at org.artofsolving.jodconverter.cli.Convert.main(Convert.java:112)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at java.util.concurrent.FutureTask$Sync.innerGet(libgcj.so.10)
   at java.util.concurrent.FutureTask.get(libgcj.so.10)
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:62)
   ...3 more
Caused by: java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at org.artofsolving.jodconverter.process.LinuxProcessManager.findPid(LinuxProcessManager.java:51)
   at org.artofsolving.jodconverter.office.OfficeProcess.start(OfficeProcess.java:65)
   at org.artofsolving.jodconverter.office.OfficeProcess.start(OfficeProcess.java:60)
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:119)
   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(libgcj.so.10)
   at java.util.concurrent.FutureTask$Sync.innerRun(libgcj.so.10)
   at java.util.concurrent.FutureTask.run(libgcj.so.10)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(libgcj.so.10)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(libgcj.so.10)
   at java.lang.Thread.run(libgcj.so.10)

提前致谢!

【问题讨论】:

  • 我已经通过放弃安装 openoffice 而是安装 libreoffice 解决了这个问题,它在安装后只需要符号链接。如果有人想为这个问题发布一个冗长有用的答案,我会给你一个答案,否则,一旦我自己回答成为一个选项,我会的。
  • 我的 java 代码遇到了同样的异常。你能帮帮我吗?

标签: centos openoffice.org centos6 jodconverter


【解决方案1】:

我安装了 Java GCJ,但它导致了同样的错误。即,确保您安装了正确版本的 JAVA(我假设您需要 OpenJDK 运行时环境)。

找到您想要的包yum search java 和/或yum provides java。在我的例子中是java-1.7.0-openjdk.x86_64,然后:

yum install java-1.7.0-openjdk.x86_64

别忘了删除以前的版本 (yum remove)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-29
    • 2023-03-23
    • 2013-12-17
    • 1970-01-01
    • 2018-08-30
    • 1970-01-01
    • 1970-01-01
    • 2017-08-04
    相关资源
    最近更新 更多