这个原因是

高版本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. 开源Java诊断工具Arthas:开篇之watch实战

    一.前言 还在为排查Java程序线上问题头痛吗,看我们用阿里开源的诊断神器 Arthas 来帮您 本文开篇主要介绍 阿里开源的诊断神器Arthas 3.7.0版本,watch.jad.classloa ...

  2. github.com/yuin/gopher-lua 踩坑日记

    本文主要记录下在日常开发过程中, 使用 github.com/yuin/gopher-lua 过程中需要注意的地方. 后续遇到其他的需要注意的事项再补充. 1.加载LUA_PATH环境变量 在实际开发 ...

  3. 【知识杂谈#2】如何查看Linux的(本地与公网)IP地址与SSH服务的端口号

    1. 本地Ip地址查看 使用查看linux主机是否有net-tools dpkg -l net-tools 显示以下代码就说明已安装成功 ||/ Name Version Architecture D ...

  4. .Net析构函数再论(CLR源码级的剖析)

    前言 碰到一些问题,发觉依旧没有全面了解完全析构函数.本篇继续看下析构函数的一些引申知识. 概述 析构函数目前发现的总共有三个标记,这里分别一一介绍下.先上一段代码: internal class P ...

  5. Travelling Salesman and Special Numbers

    prologue 模拟赛的一道题,结果没做出来,丢大人,败大兴.所以过来糊一篇题解. analysis 我们看到数据范围这么大,那么肯定不可以一个一个遍历(废话),所以就要考虑这个题目的性质. 我们先 ...

  6. [GKCTF 2020]cve版签到

    通过题目的提示可知,这是一个CVE(cve-2020-7066)的复现 点击进之后也无回显 看了这个cve之后,知道这个cve就是这个get_headers()会截断URL中空字符后的内容 就根据cv ...

  7. 手撕Vuex-Vuex实现原理分析

    本章节主要围绕着手撕 Vuex,那么在手撕之前,先来回顾一下 Vuex 的基本使用. 创建一个 Vuex 项目,我这里采用 vue-cli 创建一个项目,然后安装 Vuex. vue create v ...

  8. html-7(JavaScript-1)

    放在函数里面 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <ti ...

  9. MySQL防止被黑,通过跳板机ssh隧道访问

    更新了另外一篇,比这篇的方法更好:[https://www.cnblogs.com/scottyzh/p/17745527.html](服务器没有开放3306端口 远程访问MySQL数据库方法) 一. ...

  10. JVM-内部类分析

    一.内部类和外部类调用及字节码解释 外部类使用 内部类: 非静态内部类: JVM字节码 非静态内部类类 多了一个外部类对象的属性:final synthetic Field this$0:" ...