学习响应式编程中遇到的奇奇怪怪的问题

文章描述了一个开发者在尝试启动SpringBoot项目时遇到的问题,涉及ReactiveWebServerFactory未定义,以及后续查找依赖、版本和代码的对比,发现是Maven部署配置中的错误。作者最后通过创建新项目避免了这个问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

spring项目无法启动

Description:

Web application could not be started as there was no org.springframework.boot.web.reactive.server.ReactiveWebServerFactory bean defined in the context.

Action:

Check your application’s dependencies for a supported reactive web server.
Check the configured web application type.
在这里插入图片描述
从头到尾查了一遍。项目也不是很复杂,从依赖,版本,到代码都对比了,没啥差但是就是启动报错
也清理了idea的缓存
查了半天最终放弃

结论

没有找到原因,也没有解决,重新开了一个新项目,就没遇到这个报错了

哎 这个也报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy (default-deploy) on project reactor: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::url parameter -> [Help 1]
在这里插入图片描述

=============================== 更新 ==============================
2024年1月23日,上次遇到的奇怪问题已经解决了,主要是错别字
maven的配置很简单

<?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>org.example</groupId>
    <artifactId>reactor</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.1.6</version>
    </parent>
    <dependencies> 
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
         </dependency>
    </dependencies> 
</project>

在这里插入图片描述
这里的名字错了。。。改成
在这里插入图片描述
显然这样起名真心不好

类似这样不带上reactor的会好一些

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值