0

I was trying to run a JAR file for the project, but the following error shows up :

Caused by: java.lang.ClassNotFoundException: org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer

I tried to look for the class manually within my libraries, but the class was not present. It seems the specific class is not present in the current version of spring-boot-starter-web. Below is the POM for the project

<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>
1

2 Answers 2

1

I added my project folder resources/META-INFO/spring.factories. After that, I got the same error above. I remove the folder and my project starts well!

Sign up to request clarification or add additional context in comments.

Comments

0

Try adding the following dependency :

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

The dependency spring-boot-starter includes the dependencies for logging spring-boot-starter-logging, which has the class org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.