相关文章推荐
冷冷的硬盘  ·  详解Adorner Layer - ...·  1 年前    · 
兴奋的开水瓶  ·  Spring Cloud ...·  2 年前    · 
精彩文章免费看

required a bean of type 'springfox.documentation.schema.TypeNameExtractor' that could not be found

项目启动报错

Description:

Parameter 0 of constructor in com.github.xiaoymin.knife4j.spring.plugin.DynamicResponseModelReader required a bean of type 'springfox.documentation.schema.TypeNameExtractor' that could not be found.

Action:

Consider defining a bean of type 'springfox.documentation.schema.TypeNameExtractor' in your configuration.

出现springfox.documentation.schema.TypeNameExtractor这个一定是swagger的原因了;
我是因为引入了一个jar包,这个jar包里面包含了swagger,通过exclusion排除调就好了;

          <exclusions>
                <exclusion>
                    <artifactId>springfox-swagger2</artifactId>
                    <groupId>io.springfox</groupId>
                </exclusion>
                <exclusion>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.springfox</groupId>
                    <artifactId>springfox-swagger-ui</artifactId>
                </exclusion>
            </exclusions>

如果你也遇到同样的问题,请注意项目中的swagger,每个情况不太一样,但是肯定是这个swagger引起的,要结合这个去解决;

最后编辑于:2022-08-19 15:17