当前位置:网站首页>神奇的POI读取excel模板文件报错
神奇的POI读取excel模板文件报错
2022-06-27 19:23:00 【高粱】
项目读取excel报错, poi版本从3.7升到4.1.2
使用高版本api
workbook = WorkbookFactory.create(inputStream);
出现无法读取的错误
Your stream was neither an OLE2 stream, nor an OOXML stream
思前想后 发现maven构建项目excel文件到target目录classes文件夹下会自动进行编译 导致poi读取文件流错误
添加排除指定文件的maven配置即可
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
<nonFilteredFileExtension>xml</nonFilteredFileExtension>
<nonFilteredFileExtension>zip</nonFilteredFileExtension>
<nonFilteredFileExtension>rar</nonFilteredFileExtension>
<nonFilteredFileExtension>properties</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</plugins>
</build>
边栏推荐
- Go from entry to practice - dependency management (notes)
- 体验Navicat Premium 16,无限重置试用14天方法(附源码)
- Original translation | comparison of machine learning model service tools: kserve, Seldon core and bentoml
- String类的常用方法
- 让马化腾失望了!Web3.0,毫无希望
- 关于企业数字化的展望(38/100)
- 小王的面试训练任务
- SQL必需掌握的100个重要知识点:组合 WHERE 子句
- 100 important knowledge points that SQL must master: creating calculation fields
- CEPH distributed storage
猜你喜欢
一套系统,减轻人流集中地10倍的通行压力
mysql使用笔记一
Wechat applet based service management system for college party members' Home System applet graduation design, Party members, activists, learning, punch in, forum
本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
GFS分布式文件系统
Codeforces Round #717 (Div. 2)
白嫖红队goby&POC,叫你如何白嫖?
Go从入门到实战—— 多路选择和超时控制(笔记)
非常全面的DolphinScheduler(海豚调度)安装使用文档
让马化腾失望了!Web3.0,毫无希望
随机推荐
Go从入门到实战——package(笔记)
Go从入门到实战——CSP并发机制(笔记)
SQL必需掌握的100个重要知识点:IN 操作符
Day8 ---- 云资讯项目介绍与创建
Open a new ecological posture | use the wrodpress remote attachment to store it in COS
Tutorial | fNIRS data processing toolkit homer2 download and installation
Codeforces Round #717 (Div. 2)
GoLand永久激活
Animal breeding production virtual simulation teaching system | Sinovel interactive
Go从入门到实战——多态(笔记)
MYSQL 性能优化 index 函数,隐藏,前缀,hash 索引 使用方法(2)
Focus! Tips for installing fonts on domestic computers
使用storcli工具配置RAID,收藏这一篇就够了
Very comprehensive dolphin scheduler installation and use documents
Codeforces Round #723 (Div. 2)
Shell command used in actual work - sed
体验Navicat Premium 16,无限重置试用14天方法(附源码)
白嫖红队goby&POC,叫你如何白嫖?
String类的常用方法
请教CMS小程序首页的幻灯片在哪里设置?