我使用POI 3.17,并将XWPFChart更新为4.1.1。
首先,我在测试中遇到了这个问题:
NoClassDefFound Could not initialize class ...
通过添加1个依赖项并将其替换为最后一个位置 ooxml-schemas
解决了此问题 <dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.3</version>
</dependency>
现在我有一个错误:
valueLogger.error(/ document / html3,{}) org.apache.commons.jxpath.JXPathNotFoundException:xpath没有值:/ document / html3
在下面的代码中:
public void error(String xpath, Throwable throwable) {
LOGGER.info("valueLogger.error({},{})", xpath, throwable);
}
但是我没有改变!