SpringBoot 3.5.10引入springdoc-openapi-starter-webmvc-ui版本

SpringBoot 3.5.10 引入openapi 3.0.1包,包版本过高报错;

pom.xml

xml 复制代码
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>3.0.1</version>
            <scope>compile</scope>
        </dependency>

版本过高 编译即报错 编译失败:

复制代码
***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'conventionErrorViewResolver', defined in class path resource [org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Disconnected from the target VM, address: '127.0.0.1:60346', transport: 'socket'

SpringBoot 3.5.10 引入openapi 2.6.0包,openapi包版本过低报错;

xml 复制代码
 <!-- SpringDoc OpenAPI(接口文档,替代Swagger2) -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
			<version>2.6.0</version>
            <scope>compile</scope>
        </dependency>

版本过低:

服务器内部错误:Handler dispatch failed: java.lang.NoSuchMethodError: 'void o

实践结论:

jdk17 ,springboot3.5.10 ,使用openapi 版本在 2.7.0 - 2.8.15 区间的都可以。

相关推荐
代码AI弗森15 小时前
一文理清楚“算力申请 / 成本测算 / 并发评估”
java·服务器·数据库
Java开发的小李15 小时前
SpringBoot + Redis 实现分布式 Session 共享(解决多实例登录状态丢失问题)
spring boot·redis·分布式
Old Uncle Tom15 小时前
OpenClaw 记忆系统 -- 记忆预加载
java·数据结构·算法·agent
小小小米粒15 小时前
Collection单列集合、Map(Key - Value)双列集合,多继承实现。
java·开发语言·windows
前端一小卒16 小时前
我用 Claude Code 的 Superpowers 技能链写了个服务,部署前差点把服务器搞炸
前端·javascript·后端
摇滚侠16 小时前
expdp 查看帮助
java·数据库·oracle
:12116 小时前
java基础
java·开发语言
曹牧17 小时前
Spring:@RequestMapping注解,匹配的顺序与上下文无关
java·后端·spring
daixin884817 小时前
cursor无法正常使用gpt5.5等模型解决方案
java·redis·cursor
韦禾水18 小时前
记录一次项目部署到tomcat的异常
java·tomcat