spring-boot - 类路径资源 [org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.class] 无法打开,因为它不存在
问题描述
我 在 IntelliJ 上关注https://spring.io/guides/gs/accessing-data-mysql/ 。但是在我执行 spring-boot:run 命令后,会发生以下错误
org.springframework.beans.factory.BeanDefinitionStoreException:无法处理配置类的导入候选 [org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$WebFluxConfig];嵌套异常是 java.io.FileNotFoundException:类路径资源 [org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.class] 无法打开,因为它不存在
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nathan</groupId>
<artifactId>accessing-data-mysql</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
</parent>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<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.boot/spring-boot-starter-data-jpa -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.1.3.RELEASE</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-couchbase -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-couchbase</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.1.5.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
应用程序属性
spring.jpa.hibernate.ddl-auto=create
spring.datasource.url=jdbc:mysql://localhost:3306/db_example
spring.datasource.username=spring_user
spring.datasource.password=123456789
解决方案
我认为你的主要课程是错误的,你正在使用这样的东西:
SpringApplication.run(SpringBootApplication.class);
请确保SpringApplication.run()
在您的主类上调用该方法(以下示例中的MainApplication):
@SpringBootApplication
public class MainApplication{
public static void main(String[] args){
SpringApplication.run(MainApplication.class, args);
}
}
推荐阅读
- php - Azure 应用服务 PHP Laravel CSS 未加载
- python - 将字符串列表转换为整数
- logging - 使用 logOnNext 使用 Reactor 记录 MDC
- google-sheets - 获取当前工作表中填写的最后一行值
- laravel - Laravel 雄辩的关系有很多关节
- javascript - 如何使用 React JS 以 BYTE ARRAY 格式将图像上传到 ASP.NET CORE WEB API,400 错误请求
- r - 如何排除 dplyr 范围内的值?
- angular - 将任何语言环境日期转换为 en-US 语言环境日期字符串
- php - symfony createForm 动态参数错误
- python - 将一个数据框的样式结果复制到另一个