Unabletoscandocumentationcontextdefaultjava.l。。。
运⾏springboot项⽬报错
Unable to scan documentation context default java.lang.NullPointerException: null
at springfox.documentation.ts.ModelContext.<init>(ModelContext.java:89)
at springfox.documentation.ts.ModelContext.fromParent(ModelContext.java:264)
at springfox.documentation.peName(ModelReferenceProvider.java:108)
at springfox.documentation.delReference(ModelReferenceProvider.java:71)unable
at springfox.documentation.schema.ModelReferenceProvider.apply(ModelReferenceProvider.java:61)
at springfox.documentation.schema.ModelReferenceProvider.apply(ModelReferenceProvider.java:39)
at springfox.documentation.schema.ModelProperty.updateModelRef(ModelProperty.java:128)
at springfox.documentation.spring.web.scanners.ApiModelReader.findSameModels(ApiModelReader.java:322)
at springfox.documentation.spring.web.ModelBranch(ApiModelReader.java:245)
at springfox.documentation.spring.web.scanners.ApiModelReader.lambda$mergeModelBranch$8(ApiModelReader.java:192)
at java.base/java.ElseGet(Optional.java:369)
at springfox.documentation.spring.web.ModelBranch(ApiModelReader.java:192)
at springfox.documentation.spring.web.scanners.ApiModelReader.lambda$read$4(ApiModelReader.java:145)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
at java.base/java.util.pyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at springfox.documentation.spring.web.ad(ApiModelReader.java:144)
at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:144)
at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentation
Scanner.java:69)
at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.scanDocumentation(AbstractDocumentationPluginsBootstrapper.jav at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBoo at springfox.documentation.spring.web.tRefreshedEventExecute(SpringIntegrationDocume at t.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:305) [4 skipped]
at t.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190)
at t.ApplicationEvent(ApplicationListenerMethodAdapter.java:153)
at t.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleAp
plicationEventMulticaster.java:172)
at t.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at t.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at t.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at t.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at t.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:897)
at org.springframework.t.ReactiveWebServerApplicationContext.finishRefresh(ReactiveWebServerApplicationContext.java:129)
at t.fresh(AbstractApplicationContext.java:553)
at org.springframework.fresh(ReactiveWebServerApplicationContext.java:66)
at org.springframework.fresh(SpringApplication.java:747)
at org.springframework.freshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at eu.vptech.checkoutexp.checkout.CheckoutApplication.main(CheckoutApplication.java:11)
原因:
swagger注解问题
这个报错是由于swagger相关注解格式问题导致的。主要检查swagger直接是否存在格式问题。
检查:
1、检查@ApiImplicitParams注解中最后⼀个@ApiImplicitParam是不是加了逗号“,";
2、检查@ApiImplicitParam是否数据类型和参数数据类型不同;
3、检查实体类中,字段使⽤public修饰,修改为private;......
补充:
检查@ApiImplicitParam中必要参数是否填写,如name
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论