经过一天时间的定位发现是poi版本的问题
原先版本:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
如果只用word的写入只用以下引入就可以,上面的是excel的读写引入的poi。
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.7.3</version>
</dependency>
最后经过不通项目测试得出版本是:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.0</version>
</dependency>
写入输出正常
在做数据写入word模板中的时候一直报这个错误:经过一天时间的定位发现是poi版本的问题原先版本: <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.14</version> <...
org
.
apache
.
poi
JAR包,解决个人的
import
org
.
apache
.commons.beanutils.PropertyUtilsBean;
import
org
.
apache
.commons.
lang
.StringUtils;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFCell;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFCellStyle;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFFont;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFPalette;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFRichTextString;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFRow;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFSheet;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFWorkbook;
import
org
.
apache
.
poi
.hssf.util.HSSFColor;
import
org
.
apache
.
poi
.hssf.util.Region;
import
org
.
apache
.
poi
.
poi
fs.filesystem.
POI
FSFileSystem;
import
org
.
apache
.
poi
.ss.util.CellRangeAddress;
"The import
org
.
apache
.
poi
cannot be resolved"的问题
该项目是
java
.util.stream及其各种支持接口的替代API,该接口允许引发已检查的异常。
用法示例:
Stream<String> names = Stream.of("
java
.
lang
.Object", "
java
.util.stream.Stream");
ThrowingStream<String> s = ThrowingStream.of(names,
ClassNotFoundException.class);
s.map(
ClassLoader
.getSystem
ClassLoader
()::loadClass).forEach(System.out::println);
class
java
.
lang
.Object
interface
java
.util.stream.Stream
今天用easyExcel写一个读取excel测试类,报异常:
No valid entries or contents found, this is not a valid OOXML (Office Open XML) file
org
.
apache
.
poi
.
openxml
4j.
exceptions
.
NotOfficeXmlFileException
: No valid entries or contents found, this is not a valid OOXML (Office Open XM
org
.
apache
.
poi
.
openxml
4j.
exceptions
.
OLE
2
NotOfficeXmlFileException
: The supplied data appears to be in the
OLE
2 Format.
You are calling the part of
POI
that deals with OOXML (Office Open XML) D.
org
.
apache
.
poi
JAR包,解决import
org
.
apache
.
poi
.hssf.usermodel.HSSFWorkbook;
支持office全系excel文件解析。
import
org
.
apache
.
poi
.hssf.usermodel.HSSFCell;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFRow;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFSheet;
import
org
.
apache
.
poi
.hssf.usermodel.HSSFWorkbook;
import
org
.
apache
.
poi
.xssf.usermodel.XSSFCell;
import
org
.
apache
.
poi
.xssf.usermodel.XSSFRow;
import
org
.
apache
.
poi
.xssf.usermodel.XSSFSheet;
import
org
.
apache
.
poi
.xssf.usermodel.XSSFWorkbook;
常会遇到报找不到类的问题,有时是没有引入相关类,但很多时候明明是有的,现把原因简单总结如下:
1、
java
.
lang
.ClassNotFoundException: com.alibaba.nacos.client.logging.NacosLogging
调试spring cloud alibaba总报这个错,查到对应包nacos-client-2.0.3有此类,双击无法打开,果断判断是包下载问题,去仓库删除下载包,maven重新下载,搞定!
2、还有一种常见的报错原因是引入了不同版本的包,两个包都
import
java
.util.List;
import
org
.
apache
.
poi
.
openxml
4j.
exceptions
.InvalidFormatException;
imp...