[spring boot | springboot web ] spring boot web项目启动失败问题

文章目录

问题

java: java.lang.ExceptionInInitializerError Unable to make field private

com.sun.tools.javac.processing**.JavacProcessingEnvironment**$DiscoveredProcessors

com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs

accessible: module jdk.compiler does not "opens
com.sun.tools.javac.processing" to unnamed modul
e @2672fcab

java.lang.ExceptionInInitializerError Unable to make field private

com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs

accessible module jdk.compiler does not "opens

com.sun.tools.javac.processing"

Error starting ApplicationContext. To display the condition evaluation

report re-run your application with 'debug' enabled.

2026-03-08T23:34:14.824+08:00 ERROR 1372 --- main

o.s.b.d.LoggingFailureAnalysisReporter : ***************************

APPLICATION FAILED TO START *************************** 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.

Process finished with exit code 1

解决 maven

1.maven

2.maven

在 Maven 或 IDEA 添加 JVM 参数:··--add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED

Maven命令行编译:
mvn clean install -DforkCount=0 -DargLine="--add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED"

3. (升级注解处理器 / 依赖版本)

Lombok 版本过旧导致的

Lombok :升级到 最新 1.18.x

xml 复制代码
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.32</version>
</dependency>

最新版 Lombok 已经完全兼容 JDK17。

问题3.启动失败无web相应的依赖

在web模块中添加---"pom.xml"":

xml 复制代码
<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
<!--            <version>3.0.4</version>-->
        </dependency>
相关推荐
Hilaku几秒前
技术好就能升职是前端圈最大的谎言!
前端·javascript·程序员
卷无止境2 分钟前
FastAPI 的可观测性进化,从打日志到看清整个系统的呼吸
后端·python·fastapi
lhldsg2 分钟前
树洞倾诉的核心需求与产品定位误区
java·前端·小程序
光影少年14 分钟前
react navite高频手写/实操题
前端·javascript·react native·react.js·前端框架
MetaLite15 分钟前
SpringBoot防重复提交-加一把Redis锁就够吗
spring boot·redis·后端
卷无止境19 分钟前
FastAPI 的 CI/CD 之路,从代码提交到线上运行
后端·python·fastapi
计算机毕设定制辅导-无忧学长24 分钟前
《基于SpringBoot的图书管理系统设计与实现》
java·spring boot·后端
小蒜学长24 分钟前
借助于大模型工具Cursor的中药材交易系统的设计与实现(代码+数据库+LW)
java·数据库·spring boot·后端
hunterandroid28 分钟前
HarmonyOS 弱网与离线优先架构实战:请求队列、本地缓存与增量同步
前端·前端框架
lhldsg32 分钟前
宠物同城领养平台开发实战:从需求分析到上线部署指南
java·前端·小程序·需求分析·宠物