openOffice conversion failed: could not load input document

各位,在使用openOffice结合jodconverter 把word文件转换为html时,发现总是报异常:com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: conversion failed: could not load input document;

但是,这个问题是偶发的,偶尔传一个文件,也能正常转换,没有任何问题;

调试源码发现在

private void loadAndExport(String inputUrl, Map/*<String,Object>*/ loadProperties, String outputUrl, Map/*<String,Object>*/ storeProperties) throws OpenOfficeException {
		XComponent document;
		try {
		    document = loadDocument(inputUrl, loadProperties);
		} catch (ErrorCodeIOException errorCodeIOException) {
		    throw new OpenOfficeException("conversion failed: could not load input document; OOo errorCode: " + errorCodeIOException.ErrCode, errorCodeIOException);
		} catch (Exception otherException) {
            throw new OpenOfficeException("conversion failed: could not load input document", otherException);
        }
		if (document == null) {
		    throw new OpenOfficeException("conversion failed: could not load input document");
		}
		
		refreshDocument(document);
		
		try {
		    storeDocument(document, outputUrl, storeProperties);
        } catch (ErrorCodeIOException errorCodeIOException) {
            throw new OpenOfficeException("conversion failed: could not save output document; OOo errorCode: " + errorCodeIOException.ErrCode, errorCodeIOException);
        } catch (Exception otherException) {
            throw new OpenOfficeException("conversion failed: could not save output document", otherException);
        }
	}

 document = loadDocument(inputUrl, loadProperties);
获得document为null,所以 throw new OpenOfficeException("conversion failed: could not load input document");

很费解为什么得到的document为null呢;

以下是本人尝试的解决途径:

 

  1 )  I solved the problem by installing "Writer" and "Calc" components on OpenOffice.org side.
Good luck.    --》 照做,没有解决问题

 

  2 ) 配置openOffice的  environment variable : C:\Program Files\OpenOffice.org 3\program  --》照做,没有解决问题

 

  3 ) 确认openOffice服务已经启动

 

以上是本人的解决方案,望大家帮忙解决下,谢谢。。。

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值