java - 找不到 apache poi 的类
问题描述
我正在使用 Apache POI (3.17) 创建一些带有图表的工作表。
我使用时遇到以下问题:
XSSFChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
bottomAxis.getMajorGridLines(); // here give error
它抛出:
org.openxmlformats.schemas.drawingml.x2006.chart.CTChartLines 类型无法解析。它是从所需的 .class 文件中间接引用的
XSSFChartAxis 类型中的方法 getMajorGridLines() 指的是缺少的类型 CTChartLines
来自 CTValAx 类型的 addNewMajorGridlines() 方法指的是缺少的类型 CTChartLines
我的 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>
推荐阅读
- c# - 基于相同 ID 过滤数据
- php - Composer 更新:缺少请求的 PHP 扩展 ext-http
- reactjs - useEffect 中的 state 总是使用 React Hooks 引用初始状态
- c - 有没有办法在给定 /dev/input/eventX 文件描述符的情况下获取字符设备驱动程序的 struct input_dev ?
- ruby-on-rails - Rails 5 升级打破了延迟任务
- ruby-on-rails - Rails HTTParty 在 2 个不同的 API 中出现相同的 404 响应
- r - R:可以使用成像器加载多个图像以进行 lapply 操作吗?
- sql - 多个 CTE 查询,将单列值分配给局部变量
- neo4j - 使用 py2neo 进行图遍历
- python - Ubuntu 上的 Azure Cli 权限被拒绝错误