错误1:java.lang.IllegalArgumentException: The document is really a RTF file
截图:
情景:使用poi读取.doc文档时
原因:虽然文件的后缀是.doc,但仅文件名是xxx.doc,文件本身是.docx文件
修改:将文件另存为.doc文档
注:poi依赖引入
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.8</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.8</version>
</dependency>