这个原因是

高版本SpringBoot整合swagger 造成的

我的项目是2.7.8

swagger版本是3.0.0

就会出现上面的报错

解决方式:

1.配置WebMvcConfigurer.java

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class WebMvcConfigurer extends WebMvcConfigurationSupport {

/**
     * 发现如果继承了WebMvcConfigurationSupport,则在yml中配置的相关内容会失效。 需要重新指定静态资源
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {        registry.addResourceHandler("/**").addResourceLocations(
                "classpath:/static/");
        registry.addResourceHandler("swagger-ui.html", "doc.html").addResourceLocations(
                "classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**").addResourceLocations(
                "classpath:/META-INF/resources/webjars/");
        super.addResourceHandlers(registry);
    }

}

2.在配置文件application.yml中添加

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher

org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException报错问题的更多相关文章

  1. SpringBoot项目启动org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException解决方法

    将Pom文件中的SpringBoot版本调低即可. 我的是调成了2.5.6

  2. Failed to start bean 'stompBrokerRelayMessageHandler'; nested exception is java.lang.NoClassDefFoundError: reactor/io/codec/Codec

    最新版本的Spring需要reactor 2.0,看看你的POM有一个明确的1.1.6依赖. 解决: <dependency> <groupId>org.projectreac ...

  3. org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplic

    org.springframework.context.ApplicationContextException: Unable to start web server; nested exceptio ...

  4. ?--Porg.springframework.beans.MethodInvocationException: Property 'username' threw exception; nested exception is java.lang.NullPointerException

    使用BoneCP作为连接池,在启动Tomcat报出以下异常: 一月 02, 2016 2:12:17 下午 org.apache.tomcat.util.digester.SetPropertiesR ...

  5. SpringBoot项目意外出现 循环依赖和注入的对象意外是Null的问题 Requested bean is currently in creation: Is there an unresolvable circular reference? 或 nested exception is java.lang.NullPointerException

    1.Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ...

  6. HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException

    HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException type ...

  7. error:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

    问题:调用的方法在一个接口类中,但我并没有注入那个被调用的类 解决:在UserEntity前加上@Autowired @Controller public class MainController { ...

  8. 报错:严重: Servlet.service() for servlet [springmvc] in context with path [ ] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

    解决:service类或dao类需要@Autowired

  9. 14- Servlet.service() for servlet [mvc-dispatcher] in context with path [/collegeservice] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root caus

    有的service没有依赖注入:

  10. SpringBoot项目集成Swagger启动报错: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is

    使用的Swagger版本是2.9.2.knife4j版本是2.0.4. SpringBoot 版本是2.6.2将SpringBoot版本回退到2.5.6就可以正常启动

随机推荐

  1. 《Kali渗透基础》09. 漏洞利用、后渗透

    @ 目录 1:漏洞基本介绍 1.1:漏洞从哪里来 1.2:缓冲区溢出 1.3:如何发现漏洞 2:漏洞利用 2.1:EXP 选择与修改 2.2:避免有害的 EXP 3:后渗透阶段 3.1:Linux 上 ...

  2. Codeforces 1462F The Treasure of The Segments

    题意 给\(n(1\leq n\leq 2*10^5)\)个线段$[l_i,r_i] (1≤l_i≤r_i≤10^9) $,问最少删除几个线段,使得剩下线段中,有至少一个线段与所有线段相交. 分析 对 ...

  3. 产品代码都给你看了,可别再说不会DDD(五):请求处理流程

    这是一个讲解DDD落地的文章系列,作者是<实现领域驱动设计>的译者滕云.本文章系列以一个真实的并已成功上线的软件项目--码如云(https://www.mryqr.com)为例,系统性地讲 ...

  4. Xshell7 / Xftp7 永久免费,官网直连下载地址

    主要目的是让大家随时随地从官网下载Xshell和Xftp免费版(个人/家庭/学校免费) 最新变动:官方目前仅提供最新版以及上一个版本的软件下载!其他版本不提供下载 免费版5版本(最后一个版本,无任何限 ...

  5. centos7.9 扩容swap分区

    情况说明:在VMware vsphere的虚拟化平台下,为了快速部署虚拟服务器,我们常常使用模板部署虚拟机.但真实业务有时要求的文件系统分区和大小常常与模板不同,这时便需要自定义硬件资源和使用 LVM ...

  6. c语言代码练习4

    #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <string.h> int main() { /* ...

  7. 垃圾000000000000000000000写了很多,保存不上,发送失败了。。。。。A

    垃圾000000000000000000000写了很多,保存不上,发送失败了.....A垃圾000000000000000000000写了很多,保存不上,发送失败了.....A垃圾0000000000 ...

  8. GPT-4 API waitlist

    Skip to main content Site Navigation GPT-4 API waitlist We're making GPT-4 available as an API for d ...

  9. Mysql数据库、表设计规范指南

    结合网上资料与项目实际情况,总结下列MYSQL数据库设计规范. 一.MYSQL数据库设计规范1.数据库命名规范采用26个英文字母(区分大小写)和0-9的自然数(经常不需要)加上下划线'_'组成,禁止使 ...

  10. 11G RAC 11.2.0.1.0实例evict故障处理

    Aix 7.1 参考文档: https://blogs.oracle.com/database4cn/rac Resolving ORA-481 and "terminating the i ...