类路径资源[org / springframework / web / reactive / config / DelegatingWebFluxConfiguration.class]无法打开,因为它不存在

时间:2019-02-27 04:08:47

标签: spring-boot

我正在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]无法打开,因为它不存在

我完全遵循官方指南。那我想念的是什么?enter image description here

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

application.properties

spring.jpa.hibernate.ddl-auto=create
spring.datasource.url=jdbc:mysql://localhost:3306/db_example
spring.datasource.username=spring_user
spring.datasource.password=123456789

1 个答案:

答案 0 :(得分:0)

我认为您的主类是错误的,并且您正在使用类似这样的内容:

fullVisitorId

请确保在您的主类(例如下面的 MainApplication )中调用了SpringApplication.run(SpringBootApplication.class); 方法:

SpringApplication.run()