【问题标题】:Class not Found for apache poi找不到 apache poi 的类
【发布时间】:2018-06-26 03:00:34
【问题描述】:


我正在使用 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 感谢您的回复,我搜索的方式找不到此链接。我添加了依赖项,没有更多的错误。 &lt;dependency&gt; &lt;groupId&gt;org.apache.poi&lt;/groupId&gt; &lt;artifactId&gt;ooxml-schemas&lt;/artifactId&gt; &lt;version&gt;1.3&lt;/version&gt; &lt;/dependency&gt;

标签: java apache-poi


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2016-02-15
    • 2012-04-28
    • 2019-04-23
    • 2019-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多