zoukankan      html  css  js  c++  java
  • Hutool工具包导出Excel文件异常 You need to add dependency of poi-ooxml to your project

    Hutool工具包导出Excel文件异常 You need to add dependency of poi-ooxml to your project  

    出现如下异常信息

    cn.hutool.core.exceptions.DependencyException: You need to add dependency of 'poi-ooxml' to your project, and version >= 3.17
        at cn.hutool.poi.excel.ExcelUtil.getWriter(ExcelUtil.java:376)
        at cn.pconline.pcloud.admin.controller.train.ExamController.downRankList(ExamController.java:364)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
    省略其他。。。。

    解决方案:

    提示很明确啊,你需要引入poi-ooxml库,版本>=3.17,具体见文档:

    https://www.hutool.cn/docs/#/poi/概述

    使用Hutool工具包导出Excel例子

    贴一个使用Hutool工具导出excel的例子,方便下次复制

    • 1.添加pom依赖

    <!--Hutool工具包-->
      <dependency>
        <groupId>cn.hutool</groupId>
        <artifactId>hutool-all</artifactId>
        <version>4.5.10</version>
      </dependency>
    <!--Hutool工具ExcelUtil依赖这个 https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-->
      <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>4.1.0</version>
    </dependency>

  • 相关阅读:
    Project Euler 389 Platonic Dice (概率)
    单纯形(相关题目)
    关于C++中的内存泄露
    莫比乌斯反演与积性函数求和筛法中的一些细节
    清华集训2015-Day 2
    bzoj3456-城市规划
    多项式运算的一些技术
    bzoj2302-Problem c
    bzoj4300-绝世好题
    bzoj4726-Sabota?
  • 原文地址:https://www.cnblogs.com/pxzbky/p/13227092.html
Copyright © 2011-2022 走看看