流读取文件时可能报以下错误: java.io.IOException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
流读取文件时可能报以下错误:
java.io.IOException: Your InputStream was neither an OLE2 stream, nor an OOXML streamat org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:258)at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:221)at com.ruoyi.common.utils.poi.excelUtil.importExcel(ExcelUtil.java:186)at com.ruoyi.common.utils.poi.ExcelUtil.importExcel(ExcelUtil.java:173)
解决方法很简单,在项目的pom.xml文件内新增或补足以下代码块
<plugin> <groupId>org.apache.Maven.pluginsgroupId> <artifactId>maven-resources-pluginartifactId> <configuration> <encoding>UTF-8encoding> <nonFilteredFileExtensions> <nonFilteredFileExtension>xlsxnonFilteredFileExtension> <nonFilteredFileExtension>xlsnonFilteredFileExtension> nonFilteredFileExtensions> configuration>plugin>
来源地址:https://blog.csdn.net/spec_king/article/details/132232237
--结束END--
本文标题: java.io.IOException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
本文链接: https://lsjlt.com/news/441590.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-04-01
2024-04-03
2024-04-03
2024-01-21
2024-01-21
2024-01-21
2024-01-21
2023-12-23
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0