Apache POI error when not in IDE

女生的网名这么多〃 提交于 2020-01-07 08:46:08

问题


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.

On most PCs (Linux and Win7), everything works. On a minority of Win7 machines, however, we receive the error:

DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath.

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?

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.

I am at a loss: what could cause Apache POI to fail in this way on certain machines?


回答1:


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.

Exactly how/why LibreOffice was affecting the XML processing in Apache POI is unclear. At any rate, it is now unimportant.



来源:https://stackoverflow.com/questions/32725532/apache-poi-error-when-not-in-ide

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!