java - 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>
解决方案
我添加了我的项目文件夹资源/META-INFO/spring.factories。之后,我得到了同样的错误。我删除了文件夹,我的项目开始顺利!
推荐阅读
- python - python - 如何根据python中另一个字典键的匹配来修改字典中的键值列表?
- c++ - 当我们得到错误 Explicitly define the missing copy assignment operator.. 时,我们是否只需要定义赋值运算符?
- sql - 如何将 SQL 脚本合并到现有的 SQLite3 数据库
- kubernetes - 所有gitlab托管服务账号都可以有一定的角色绑定吗
- python - Jupyter Notebook, - 在新安装时无法启动内核
- r - 为 {pkgdown} 网站中的引用设置 {knitr} 块选项
- zoho - Zoho Deluge:如何使用大型 json 文件更新表
- angular - Angular 嵌套动态组件
- flutter - Flutter Web - 从自定义绘画中保存图像 .png
- javascript - 在 Swiper 中显示上一张和下一张幻灯片的一部分