SpringBoot整合Easypoi项目启动出错和导出文件乱码
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-09-25 14:20:53.200 ERROR 7184 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location: |
此时我的SpringBoot是2.3.3,引入的easypoi的依赖如下
<dependency> <groupId>cn.afterturn</groupId> <artifactId>easypoi-base</artifactId> <version>4.1.3</version> </dependency> ? <dependency> <groupId>cn.afterturn</groupId> <artifactId>easypoi-web</artifactId> <version>4.1.3</version> </dependency> ? <dependency> <groupId>cn.afterturn</groupId> <artifactId>easypoi-annotation</artifactId> <version>4.1.3</version> </dependency> |
其实并没有什么特别复杂的问题,将easypoi的依赖更换成
<dependency> <groupId>cn.afterturn</groupId> <artifactId>easypoi-spring-boot-starter</artifactId> <version>4.1.3</version> </dependency> |
导出文件乱码:
我遇见的分2种情况:
1、使用swagger测试导出乱码,直接使用浏览导出不乱码?
这其实只是swagger处理流的问题
<swagger2.version>2.7.0</swagger2.version> //这个版本的swagger测试,文件名和文件内容都会乱码
<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> //2.9.2的就不会,不知道是不是经过了处理 </dependency> |
2、怎么导出都乱码,可以参照 SpringBoot整合Easypoi