不在IDE中时的Apache POI错误 [英] Apache POI error when not in IDE
问题描述
我们正在使用Apache POI创建一个非常简单的电子表格.一切都在开发环境中工作.发布后,该项目将作为可运行的JAR导出;此jar和所有必需的库都放在中央服务器上.各种PC都引用这些相同的文件.
We are using Apache POI to create a very simple spreadsheet. Everything works in the development environment. When released, the project is exported as a runnable JAR; this jar and all required libraries are placed on a central server. The various PCs all reference these same files.
在大多数PC(Linux和Win7)上,一切正常.但是,在少数Win7机器上,我们会收到错误消息:
On most PCs (Linux and Win7), everything works. On a minority of Win7 machines, however, we receive the error:
无法处理DOMSource:检查saxon9-dom.jar是否在 类路径.
DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath.
我尝试了如此处建议的那样添加-D选项,无济于事.无论如何,尚不清楚为什么依赖项仅应在某些计算机上中断.库的加载顺序可能有所不同吗?
I have tried adding the -D option as suggested here, to no avail. In any case, it's unclear why the dependencies should break only on certain machines. Could there be a difference in the order that the libraries are loaded?
我还尝试将所有依赖项提取到导出的jar文件中.这个(非常胖!)jar文件在完全相同的计算机上可以工作-或不起作用.
I have also tried extracting all dependencies into the exported the jar file. This (very fat!) jar file work - or doesn't work - on exactly the same machines.
我不知所措:是什么导致Apache POI在某些机器上以这种方式失败?
I am at a loss: what could cause Apache POI to fail in this way on certain machines?
推荐答案
事实证明,这是旧版LibreOffice的问题(特别是受影响的系统仍在运行3.6版).更新为LibreOffice 5.0可以解决此问题.
This turns out to have been a problem with an older version of LibreOffice (specifically, the affected systems were still running version 3.6). Updating to LibreOffice 5.0 resolved the issue.
目前还不清楚LibreOffice如何/为什么影响Apache POI中的XML处理.无论如何,它现在已经不重要了.
Exactly how/why LibreOffice was affecting the XML processing in Apache POI is unclear. At any rate, it is now unimportant.
这篇关于不在IDE中时的Apache POI错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!