catalogue
Record the springboot error about swagger startup
Record the springboot error about swagger startup
A springboot project starts with the following error
java.lang.NullPointerException: null
at springfox.documentation.schema.Example.equals(Example.java:131)
at java.util.Objects.equals(Objects.java:59)
at springfox.documentation.service.RequestParameter.equals(RequestParameter.java:132)
at java.util.HashMap.putVal(HashMap.java:648)
at java.util.HashMap.put(HashMap.java:612)
at java.util.HashSet.add(HashSet.java:220)
at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at springfox.documentation.spring.web.readers.operation.OperationParameterReader.apply(OperationParameterReader.java:93)
at springfox.documentation.spring.web.plugins.DocumentationPluginsManager.operation(DocumentationPluginsManager.java:144)
at springfox.documentation.spring.web.readers.operation.ApiOperationReader.read(ApiOperationReader.java:72)
at springfox.documentation.spring.web.scanners.CachingOperationReader.lambda$new$0(CachingOperationReader.java:43)
at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
at springfox.documentation.spring.web.scanners.CachingOperationReader.read(CachingOperationReader.java:48)
at springfox.documentation.spring.web.scanners.ApiDescriptionReader.read(ApiDescriptionReader.java:72)
at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:169)
at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:67)
at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.scanDocumentation(AbstractDocumentationPluginsBootstrapper.java:96)
at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBootstrapper.java:82)
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:100)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at com.worsoft.worsoft.fc.WorSoftPmFcApp.main(WorSoftPmFcApp.java:20)
The reason is that after integrating swagger, an interface of the controller layer receives two entity classes with the same name. Chestnut: in a controller
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R getPmFcPerformanceBondPage(PageDto page, PmFcPerformanceBond pmFcPerformanceBond, PmFcBidBond pmFcBidBond) {
QueryWrapper<PmFcPerformanceBond> query = WrapperBuilder.generateQuery(pmFcPerformanceBond, page);
return R.ok(pmFcPerformanceBondService.page((Page) page, query));
}
It is caused by the same parameters in classes pmfcperformancebond and pmfcbidbond.
Read More:
- Springboot2.6.X configurate swagger error [How to Solve]
- [Solved] Springboot integrate swagger error: Failed to start bean ‘documentationPluginsBootstrapper‘
- SpringBoot+Swagger Error: 403 Forbidden [How to Solve]
- Springboot Integrate Swagger2 Error: Failed to start bean ‘documentationPluginsBootstrapper‘;
- [Solved] Swagger Startup Error: java.lang.NumberFormatException: For input string: ““
- [Solved] Springboot integrate swagger error: failed to start bean ‘documentationpluginsbootstrapper‘
- [Solved] Springboot Error: swagger-UI/index.html Access Error 404
- Springboot2.6X version integrate knife4j error [How to Solve]
- Springboot controls the startup of rabbitmq through configuration files
- [Solved] SpringBoot+Dubbo Startup Error: Fail to start server(url dubbo192.168.0.920880service
- [Solved] SpringBoot+Dubbo Startup Error: Fail to start server(url: dubbo://192.168.0.9:20880/service
- [Solved] IDEA springboot Startup Error: java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path
- Springboot startup error “No bean named’org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available”
- [Solved] Springboot Package jar and Startup Error: It was loaded from the following location
- [Solved] Springboot Project Startup Error: Unable to Identify bootstrap.yml Configuration
- How to Solve Swagger error: IllegalStateException
- [Solved] SpringBoot Startup Error: Unable to start LiveReload server
- SpringBoot Startup Error: Failed to start component [Connector[HTTP/1.1-8080]]
- [Solved] SpringBoot Startup Error: org.springframework.beans.factory.UnsatisfiedDependencyException Error creating
- Springboot startup error: Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl required a bean of type