java - 找不到 apache poi 的类

标签 java apache-poi


我正在使用 Apache POI (3.17) 创建一些带有图表的工作表。
我在使用时遇到以下问题:

XSSFChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
bottomAxis.getMajorGridLines(); // here give error


它抛出:

The type org.openxmlformats.schemas.drawingml.x2006.chart.CTChartLines cannot be resolved. It is indirectly referenced from required .class files
The method getMajorGridLines() from the type XSSFChartAxis refers to the missing type CTChartLines
The method addNewMajorGridlines() from the type CTValAx refers to the missing type CTChartLines

my pom.xml

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.17</version>
</dependency>
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.17</version>
</dependency>

我在 ooxml-schemas 1.3 上找到了这个类,但现在我们正在使用 poi-ooxml-schemas 3.17。
我该如何解决这个问题?

最佳答案

@Gagravarr 感谢您的回复,我搜索的方式找不到此链接。我添加了依赖项,没有再出现错误。

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>ooxml-schemas</artifactId>
    <version>1.3</version>
</dependency>

关于java - 找不到 apache poi 的类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51026963/

相关文章:

java - Android 和 Java 中的 TimeZone.getAvailableIDs

java - 删除 AppEngine DevServer 中使用的 Blob

java - 即使在执行 fileoutputstream.close() 之后,Apache-POI 也不保存 Excel 工作簿

java - 如何设置空白单元格的颜色

java - 如何将以下代码转换为 Java 8 流和 lambda

java - 如何读取.pem文件来获取私钥和​​公钥

java - 为什么 XSSFRichTextString.applyFont() 不能像 Java 文档中编写的那样工作?

使用 Apache.POI 读写 Excel 的 Java 内存问题

使用 JPA 循环遍历大型表时出现 java.lang.OutOfMemoryError

java - 如何用Java删除Excel工作表的内容?