spring boot + swagger报错记录

麻了!Spring Boot 从 2.2.5 升级到 2.7.2 之后,一堆BUG 这篇文章分享一下Spring Boot 升级到2.7的踩坑总结,还是挺全面的,希望对大家有所帮助~ 阅读详情

springboot 整合 swagger2 报错,项目不能启动


APPLICATION FAILED TO START


Description:

Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 15 were found:
- modelBuilderPluginRegistry: defined in null
- modelPropertyBuilderPluginRegistry: defined in null
- typeNameProviderPluginRegistry: defined in null
- documentationPluginRegistry: defined in null
- apiListingBuilderPluginRegistry: defined in null
- operationBuilderPluginRegistry: defined in null
- parameterBuilderPluginRegistry: defined in null
- expandedParameterBuilderPluginRegistry: defined in null
- resourceGroupingStrategyRegistry: defined in null
- operationModelsProviderPluginRegistry: defined in null
- defaultsProviderPluginRegistry: defined in null
- pathDecoratorRegistry: defined in null
- relProviderPluginRegistry: defined by method ‘relProviderPluginRegistry’ in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]
- linkDiscovererRegistry: defined in null
- entityLinksPluginRegistry: defined by method ‘entityLinksPluginRegistry’ in class path resource [org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

Process finished with exit code 0

原因:

spring boot与swagger的版本冲突了,这里我springboot项目的版本高了,swagger版本低了,不兼容。我的springboot版本为2.4,swagger版本为2.2.2,项目启动就会报如下错误:(这个问题的解决办法就是直接将pom文件中的swagger版本换成2.9.2就可以了)

Spring Boot-集成Swagger 再通过Swagger衍生出来的一系列项目和工具,就可以做到生成各种格式的接口文档,生成多种语言的客户端和服务端的代码,以及。 阅读详情

相关推荐

boot+mp搭建版本踩坑记录

由于使用高版本springboot 导致集成遇到的一些问题经过此次项目搭建,深知各个版本之前是不兼容的,以后搭建的时候,一定要提前调研好个版本之前的匹配度,否则会造成很多莫名其妙的问题~~

学海无涯,我用JAVA 818

springboot和swagger版本匹配后仍报错

有友友知道怎么回事吗。

sylvia688的博客 150

【rk3566/3568】Android 11移植gms

【rk3566/3568】Android 11移植gms 1、前言 测试功能时,想去Google play store去下个应用测试,发现通过网页搜索总是下载不到正确的谷歌服务框架;于是就不得不去搞一个内置的gms。 2、移植 1、需要下载Android 11对应的gms的包 opengapps 2、看下文件目录 直接移植core里面的文件,GAPPs Optional按需添加 3、在vendor下创建google目录 ...

lin_ff的博客 7646

springfox 源码分析(十四) 归档得到ApiListing接口集合

在前面我们拿到了接口的Model类型集合,然后还获取到了该接口的ApiDescription描述信息 此时针对这些信息,进行接口的资源整合,最终构造ApiListing类 /*** * 通过已经筛选过滤的接口集合以及context上下文对象来得到接口列表 * @param context * @return */ public Multimap<String, ApiListi...

八一菜刀的专栏 1303

Visual studio 2013 配置 Halcon 13 (非抄袭)

Visual studio 2013 配置 Halcon 13.0.2.2 (其他版本适用) 针对网上抄袭的配置方法均不可用,写了一篇亲试可行的配制方法。如下: 1.下载Halcon安装后(C:\Program Files\MVTec\HALCON-13.0) 添加环境变量,(按下win按键,键入“环境变量”,出现 “编辑系统环境变量”后按下enter即可打开,下方找到“环境变量”按钮)的系...

huyanjackson的专栏 1042

WhatsApp协议算法

我想其实有很多人还不太了WhatsApp群控,简单来说,它和我们常使用的微信聊天软件是类似的,只不过它是基于通讯录的,操作起来比较简单便捷,所以现在有很多国家都喜欢用WhatsApp。一般情况下,筛号不会造成账号被封的情况,但是呢,如果筛号的频率太快,就会被系统限制筛号能力,不再返回筛号结果,所以,筛号数量和速度一定要控制好。前天逛街突然灵光一现,为什么不试试多路访问呢,简单来说就是信道复用技术,马上跑回家,调取接口,接入通道,导入已经转换成协议的账号,成功登录!

2403_87755661的博客 1943

springfox 源码分析(五) web配置类Plugin插件的使用

时间:2019-5-23 14:46:50 地点:家中 前言 我们在上一篇文章,通过@EnableSwagger2注解,知道springfox使用开启Plugin注解的配置,注入了很多Plugin的配置类,结合我们第二篇针对Spring Plugin的使用文章介绍,该篇主要探索springfox中的各种不同Plugin的具体作用,以及声明了那些方法 插件 在SpringfoxWebMvc...

八一菜刀的专栏 3916

论文理解【LLM-OR】——【Step-Opt】Training LLMs for Optimization Modeling via Iterative Data Synthesis and

本文提出 Step-Opt-Instruct 方法,针对用 LLM 做 OR 问题求解任务,用迭代问题生成 + 分步验证机制实习更可靠的训练数据合成,从而微调开源 LLM 得到 Step-Opt。在多个 OR 建模基准提升性能,尤其在复杂问题上提升更明显

佚失的诗篇 806

required a single bean, but 2 were found

原因是在启动类加 `@ComponentScan` 注解,配置的包扫描路径重复了,导致重新生成两个bean,而且一个bean defined in null.因为xxljob组件是自己在xxljob的基础上封装的,然后项目启动报错,解决办法就是把包扫描的路径改下,不能有包含关系。

Json_Marz的博客 765

14 硬件工程师笔面试高频考点真题解析——逻辑门

逻辑门是数字电路的基本单元,实现布尔运算(如与、或、非、异或等)。OC门(集电极开路)和OD门(漏极开路)需外接上拉电阻,支持“线与”逻辑,适用于I2C总线等场景,避免推挽输出并联导致的短路问题。三态门具有高、低、高阻三种状态,用于总线分时复用。推挽输出因内置上下管,禁止并联,否则会引发电源短路。三者区别在于:推挽驱动强但不可并联;OC/OD需上拉,支持线与;三态门通过使能控制实现高阻隔离,适用于共享总线设计。

XU157303764的博客 1902

SwiftUI 5 教程之 SwiftData使用入门(教程含源码)

对我来说,记住日期很难。是的,您可以设置该日期的提醒,但该提醒无法产生紧迫感。让我们创建一个应用程序,我们可以在其中添加将来发生的事件。如果我们可以在主应用程序上看到所有即将发生的活动,那就太好了。也许将它们添加到小部件上以营造紧迫感。对于任何事件,我们需要跟踪哪些事情?我们将在下一篇文章中添加更多属性,其中我们将讨论迁移。现在,这就是我们所需要的。开始吧。

iCloudEnd的博客 987

SpringBoot与Swagger整合Error starting ApplicationContext. To display the conditions report re-run your

在进行SpringBoot与Swagger整合配置过程中,出现了以下错误: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-12-10 15:14:16.587 ERROR 6536 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : **

weixin_45457983的博客 3065

【爬虫实战】Instagram博主图片爬取:模拟登录+滚动加载,轻松抓取高清美图

在当今社交媒体时代,Instagram作为全球最受欢迎的图片分享平台之一,汇聚了无数优质博主的海量精美图片。对于数据爱好者、营销分析师、AI训练数据收集者来说,如何高效、稳定地爬取Instagram博主的图片,成为了一项极具实用价值的技术挑战。然而,Instagram的反爬机制日益严格,传统的静态页面请求已经无法满足需求。本文将带你从零开始,使用2024-2025年最新技术栈,实现模拟登录、滚动加载、高清图片下载的全流程爬虫。✅ 全流程代码可直接运行✅ 模拟手机端请求绕过反爬。

2201_76125261的博客 596

【报错记录】spring boot 版本升级2.6.8 到之后的swagger3报错

【代码】【报错记录】spring boot 版本升级2.6.8 到之后的swagger3报错。

Heihei 's note 486

DAF-Net:动态注意力红外-可见光图像融合

DAF-Net 红外-可见光融合链路:IR/VIS 双分支 (Conv+ResBlock → 64ch) → DynamicAttentionFusion (Cat→Sigmoid→加权) → 重建 (Conv→Sigmoid)。TNO 上 SSIM=0.782 (vs IR), 0.734 (vs VIS), 参数量仅 218K。核心贡献:轻量动态注意力门控, 无监督 SSIM+MSE 损失不需要配准 ground truth。

FJN110的博客 319

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

SpringBoot引入swagger-spring-boot-starter莫名报错java.lang.ClassNotFoundException: javax.validation.constr

整合swagger时按照文档步骤引入dependency 在启动类中开启swagger 同时设置一个演示实例 运行出现启动错误,真的是黑脸!!! Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2021-02-19 23:02:30.415 ERROR 18524 --- [ restartedMain] o.s.bo.

yxl219的专栏 1363

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

swagger的使用及踩坑

swagger的使用有两种方式: https://blog.youkuaiyun.com/weixin_37509652/article/details/80094370 按照该博客中的第一种方式使用@EnableSwagger2Doc注解其实是直接使用的swagger默认配置,生成的页面如下, 手动配置首先要去除启动类上@EnableSwagger2Doc注解,否则会报错. 配置有两种方式, 1.配置类 /** * Swagger2API文档的配置 */ @Configuration @Enabl

十一的博客 4403

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

SpringBoot2.7.5项目配置Swagger2.9.2报错Failed to start bean documentationPluginsBootstrapper问题解决方法

SpringBoot2.7.5项目配置Swagger2.9.2报错Failed to start bean documentationPluginsBootstrapper问题解决方法

zxctime的博客 2915

整合Swagger框架:集成接口文档

Swagger 是一个用于设计、构建、记录和使用 RESTful 风格 Web 服务的开源框架。它通过提供交互式的 API 文档生成工具,使得开发人员能够更方便地测试和理解 API 的使用方法。Swagger 提供了多种工具来帮助开发者生成、描述、调用和可视化 RESTful 风格的 Web 服务。描述整个控制器的作用。描述具体的操作或方法。

2201_75732091的博客 582

swagger2避坑记录

swagger2避坑记录

xu123_chao的博客 409

SpringBoot集成Swagger2

根据百度提示,因为我的swagger配置类和SpringBoot启动了不在一个Modul里,出现上面的问题可以通过在SpringBootApplication启动类加个注解(com.XXXXX.config是配置类所在路径包名)页面虽然进到了Swagger文档页面,但是确没有我创建的Controller对应的接口文档,提示No operations defined in spec!自己构建项目过程中想用下Swagger做接口文档管理,就记录下集成Swagger2过程。说明还是有问题,还需要解决。

weixin_48288941的博客 344

周记十五--后端和前端的桥梁swagger

本周学习 本周开始写项目,前端后端的第一次交互,说实话看着有点懵,前后端交互的第一步swagger我们一直在尝试,结果是一直报错,各种解决方法都找了一边还是不行,说一下我们配置swagger环境的基本步骤吧,大家看一下问题出现在哪里. 第一步 maven引入相关jar包 <!-- swagger --> <dependency> <groupId>com.mangofactory</g...

weixin_60257072的博客 289

麻了,Spring Boot 从 2.2.5 升级到 2.7.2 之后,一堆BUG

这篇文章分享一下Spring Boot 升级到2.7的踩坑总结,还是挺全面的,希望对大家有所帮助~

AS011x的博客 1142

基于Spring Boot的宠物健康管理系统实战:从设计到部署

管理系统是企业级Web应用最常见的实训场景,涉及用户权限、数据处理与业务流转等核心概念。基于Spring Boot构建的B/S架构,通过Spring Security与JWT实现无状态认证授权,配合MyBatis-Plus简化数据持久层操作,可将复杂需求拆解为可落地的模块。该系统在工程实践中具有广泛的价值,尤其适合课程设计、毕业设计以及初级开发者学习完整技术栈的整合。宠物健康管理系统正是这样一个典型载体,其业务涵盖档案管理、疫苗接种计划、健康指标追踪、文件上传和定时提醒等真实功能。文章从数据库设计、后端接口

weixin_31220401的博客 185

Spring Boot 2.x——SpringBoot3.3.5全栈升级与框架适配总结(技术分享版)

本次升级以为核心,完成环境升级、依赖替换、代码迁移、问题修复,成功解决包名迁移、依赖冲突、Bean 异常、编译错误、文档失效五大类问题。项目实现编译成功、启动无报错、功能全覆盖、AI 正常运行,技术栈规范、稳定、可长期维护,可为同类 Spring Boot 3 升级项目提供完整参考方案。

2301_80986465的博客 515

Spring Boot整合swagger使用教程(这一篇就够了)

Spring Boot整合swagger使用教程(这一篇就够了)

qq_27480007的博客 4万+
上一篇: 面向对象基本概念
下一篇: @MapperScan与@Maaper
Magic__java
博客等级 码龄8年 0粉丝 5原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值