zoukankan      html  css  js  c++  java
  • 关于spring boot在启动的时候报错: java.lang.Error: generate operation swagger failed, xxx.xxx.xxx

     1 Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
     2 2018-10-31 10:42:43:043 [restartedMain] [ERROR] org.springframework.boot.SpringApplication >> Application startup failed
     3 java.lang.Error: generate operation swagger failed, xxx.xxx.xxx.webapp.WebappDevLightController:exportPoleAndLightInfoList
     4     at org.apache.servicecomb.swagger.generator.core.SwaggerGenerator.scanMethods(SwaggerGenerator.java:250)
     5     at org.apache.servicecomb.swagger.generator.core.SwaggerGenerator.generate(SwaggerGenerator.java:138)
     6     at org.apache.servicecomb.core.definition.schema.AbstractSchemaFactory.generateSwagger(AbstractSchemaFactory.java:109)
     7     at org.apache.servicecomb.core.definition.schema.ProducerSchemaFactory.createSchema(ProducerSchemaFactory.java:127)
     8     at org.apache.servicecomb.core.definition.schema.ProducerSchemaFactory.createSchema(ProducerSchemaFactory.java:55)
     9     at org.apache.servicecomb.core.definition.schema.AbstractSchemaFactory.getOrCreateSchema(AbstractSchemaFactory.java:65)
    10     at org.apache.servicecomb.core.definition.schema.ProducerSchemaFactory.getOrCreateProducerSchema(ProducerSchemaFactory.java:88)
    11     at org.apache.servicecomb.provider.rest.common.RestProducerProvider.init(RestProducerProvider.java:48)
    12     at org.apache.servicecomb.core.provider.producer.ProducerProviderManager.init(ProducerProviderManager.java:56)
    13     at org.apache.servicecomb.core.SCBEngine.doInit(SCBEngine.java:202)
    14     at org.apache.servicecomb.core.SCBEngine.init(SCBEngine.java:178)
    15     at org.apache.servicecomb.core.CseApplicationListener.onApplicationEvent(CseApplicationListener.java:74)
    16     at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
    17     at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
    18     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
    19     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
    20     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
    21     at org.springframework.boot.context.event.EventPublishingRunListener.finished(EventPublishingRunListener.java:101)
    22     at org.springframework.boot.SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListeners.java:79)
    23     at org.springframework.boot.SpringApplicationRunListeners.finished(SpringApplicationRunListeners.java:72)
    24     at org.springframework.boot.SpringApplication.run(SpringApplication.java:305)
    25     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
    26     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
    27     at com.hoolink.common.rpc.CommonRpcControllerApplication.main(CommonRpcControllerApplication.java:32)
    28     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    29     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    30     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    31     at java.lang.reflect.Method.invoke(Method.java:498)
    32     at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
    33 Caused by: java.lang.Error: A nesting complex field is found in the query object and this is not supported, field name  = [data]. Please remove this field or tag @JsonIgnore on it.
    34     at org.apache.servicecomb.swagger.generator.springmvc.processor.parameter.SpringmvcDefaultObjectParameterProcessor.getFlattenParams(SpringmvcDefaultObjectParameterProcessor.java:100)
    35     at org.apache.servicecomb.swagger.generator.springmvc.processor.parameter.SpringmvcDefaultObjectParameterProcessor.process(SpringmvcDefaultObjectParameterProcessor.java:58)
    36     at org.apache.servicecomb.swagger.generator.springmvc.processor.parameter.SpringmvcDefaultParameterProcessor.process(SpringmvcDefaultParameterProcessor.java:41)
    37     at org.apache.servicecomb.swagger.generator.core.OperationGenerator.scanMethodParameters(OperationGenerator.java:293)
    38     at org.apache.servicecomb.swagger.generator.core.OperationGenerator.generate(OperationGenerator.java:176)
    39     at org.apache.servicecomb.swagger.generator.core.SwaggerGenerator.scanMethods(SwaggerGenerator.java:246)
    40     ... 28 common frames omitted

    该错误的原因是: 在我的WebappDevLightController类中exportPoleAndLightInfoList方法的入参没有添加@RequestBody注解

  • 相关阅读:
    [12/11/19] 折半&倍增思想学习笔记
    [11/07/19] CDQ学习笔记
    magic cube
    Codeforces Round #514 (Div. 2) B
    Codeforces Round #514 (Div. 2) C. Sequence Transformation
    八位数
    hdu3001Travelling
    Codeforces Round #512 E
    Codeforces Round #512 (Div. 2) D. Vasya and Triangle
    codeforces 1042 e
  • 原文地址:https://www.cnblogs.com/yanwu0527/p/9884112.html
Copyright © 2011-2022 走看看