首页 > 解决方案 > java.lang.ClassNotFoundException:org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer

问题描述

我试图为项目运行 JAR 文件,但出现以下错误:

引起:java.lang.ClassNotFoundException:org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer

我试图在我的库中手动查找该类,但该类不存在。当前版本的 spring-boot-starter-web 中似乎不存在特定类。下面是项目的POM

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.11</version>
  <scope>test</scope>
</dependency>

  <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->

  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
   <version>2.1.3.RELEASE</version>
</dependency>



  <!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa -->
  <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-jpa</artifactId>
      <version>2.1.2.RELEASE</version>
  </dependency>


  <dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>4.0.1</version>
  <scope>provided</scope>
</dependency>

  <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-dbcp2</artifactId>
      <version>2.1.1</version>
  </dependency>

标签: javaspring-boot

解决方案


我添加了我的项目文件夹资源/META-INFO/spring.factories。之后,我得到了同样的错误。我删除了文件夹,我的项目开始顺利!


推荐阅读