.apache.logging.log4j.Logger.atDebug()Lorg/apache/logging/log4j/LogBuilder;
项目中使用POI_PI但是升级后报错,因为项目整合了SpringBoot2.2而POI5.2.2中引入的版本比SpringBOOT自带的log版本高所以需要升级SpringBoot中配置
添加如下配置
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.17.2</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>log4j-api</artifactId>
<groupId>org.apache.logging.log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.2</version>
</dependency>
添加完成之后可能会报IO没有类的错,所以升级IO包版本号这两个包必须一块升级要不然会报错
<apache.commons-lang3.version>3.12.0</apache.commons-lang3.version>
<apache.commons-io.version>2.11.0</apache.commons-io.version>
同时因为POI_TI已经引入了这两个包,所以也注释掉
<!--<dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->
<!-- <version>${poi.version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml-schemas</artifactId>-->
<!-- <version>4.1.2</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <artifactId>xmlbeans</artifactId>-->
<!-- <groupId>org.apache.xmlbeans</groupId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!--</dependency>-->
完成收工!!!!
|