zoukankan      html  css  js  c++  java
  • Java查询Excel模版时出现org.apache.poi.poifs.filesystem.OfficeXmlFileException异常

    org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)

    该错误意思是说,文件中的数据是用Office2007+XML保存的,而现在却调用OLE2 Office文档处理,应该使用POI不同的部分来处理这些数据,比如使用XSSF来代替HSSF。

    只需要导入poi的包即可!!!

    1、百度输入 mvn repository,找到第一个网址打开:https://mvnrepository.com/    在输入框输入:poi

    2、选择一个版本,凭我的经验,不要选择beta版本,也不要选择最新的按本。

    3、点进去,copy如下内容,复制到自己pom.xml。更新一下,即可解决

    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.13</version>
    </dependency>

    本文来自博客园,作者:编程狸,转载请注明原文链接:https://www.cnblogs.com/ping-pong/p/9843911.html

  • 相关阅读:
    NOI Online 2020 提高组游记
    【HDU5840】This world need more Zhu
    CSP-S 2019 AFO记
    防错笔记
    关于Blog
    题解 【UER #6】逃跑
    动态规划杂题选记
    有趣计数题选做
    题解 [POI2012] Leveling Ground
    xioa han 带画家!
  • 原文地址:https://www.cnblogs.com/ping-pong/p/9843911.html
Copyright © 2011-2022 走看看