You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/12/16 09:03:33 UTC

[GitHub] [servicecomb-java-chassis] myVictor opened a new issue #2139: @RequestBody 启动报错2.x

myVictor opened a new issue #2139:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2139


   Caused by: java.lang.IllegalStateException: generate swagger operation failed
   
   我看springmvc标签支持表是支持的。 [](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/springmvc/)
   
    @RequestMapping(value = "/result.action",produces = "application/json")
    @ResponseBody
    public ModelMap result(@RequestBody StudentVo studentVo)
   
   这种写法问题在哪,应该怎么写?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2139: @RequestBody 启动报错2.x

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2139:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2139#issuecomment-746011264


   可能是 StudentVo 存在抽象类和接口, 需要看下你的详细错误。 [类型支持说明参考](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/interface-constraints/), 可以先了解下和 spring boot的差异。 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] myVictor commented on issue #2139: @RequestBody 启动报错2.x

Posted by GitBox <gi...@apache.org>.
myVictor commented on issue #2139:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2139#issuecomment-746038469


   具体信息:
   实体类:
   public class StudentVo {
   
       private String name;
   
       private int age;
   
       private Date time;
   
       public String getName() {
           return name;
       }
   
       public void setName(String name) {
           this.name = name;
       }
   
       public int getAge() {
           return age;
       }
   
       public void setAge(int age) {
           this.age = age;
       }
   
       public Date getTime() {
           return time;
       }
   
       public void setTime(Date time) {
           this.time = time;
       }
   }
   
   
   异常信息:
   java.lang.IllegalStateException: ServiceComb init failed.
   	at org.apache.servicecomb.core.SCBEngine.run(SCBEngine.java:331) ~[java-chassis-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.core.CseApplicationListener.onApplicationEvent(CseApplicationListener.java:87) ~[java-chassis-core-2.1.3.jar:2.1.3]
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]
   	at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:102) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
   	at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:77) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
   	at org.example.StudentMan.main(StudentMan.java:18) [classes/:na]
   Caused by: java.lang.IllegalStateException: generate swagger operation failed, method=org.example.controller.HelloController:result.
   	at org.apache.servicecomb.swagger.generator.core.AbstractSwaggerGenerator.scanMethods(AbstractSwaggerGenerator.java:301) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.core.AbstractSwaggerGenerator.generate(AbstractSwaggerGenerator.java:119) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.SwaggerGenerator.generate(SwaggerGenerator.java:32) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.engine.SwaggerEnvironment.checkAndGenerateSwagger(SwaggerEnvironment.java:165) ~[swagger-invocation-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.engine.SwaggerEnvironment.createProducer(SwaggerEnvironment.java:109) ~[swagger-invocation-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.core.provider.producer.ProducerProviderManager.registerSchema(ProducerProviderManager.java:102) ~[java-chassis-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.core.provider.producer.ProducerProviderManager.registerProducerMetas(ProducerProviderManager.java:87) ~[java-chassis-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.core.provider.producer.ProducerProviderManager.init(ProducerProviderManager.java:73) ~[java-chassis-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.core.SCBEngine.doRun(SCBEngine.java:368) ~[java-chassis-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.core.SCBEngine.run(SCBEngine.java:319) ~[java-chassis-core-2.1.3.jar:2.1.3]
   	... 12 common frames omitted
   Caused by: java.lang.IllegalStateException: parameter name is not present, method=org.example.controller.HelloController:result
   solution:
     change pom.xml, add compiler argument: -parameters, for example:
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
           <compilerArgument>-parameters</compilerArgument>
         </configuration>
       </plugin>
   	at org.apache.servicecomb.swagger.generator.SwaggerGeneratorUtils.collectParameterName(SwaggerGeneratorUtils.java:212) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.ParameterGenerator.<init>(ParameterGenerator.java:58) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.ParameterGenerator.<init>(ParameterGenerator.java:70) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.core.AbstractOperationGenerator.initMethodParameterGenerators(AbstractOperationGenerator.java:234) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.springmvc.SpringmvcOperationGenerator.initMethodParameterGenerators(SpringmvcOperationGenerator.java:40) ~[swagger-generator-springmvc-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.core.AbstractOperationGenerator.initParameterGenerators(AbstractOperationGenerator.java:215) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.core.AbstractOperationGenerator.scanMethodParameters(AbstractOperationGenerator.java:195) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.core.AbstractOperationGenerator.generate(AbstractOperationGenerator.java:155) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	at org.apache.servicecomb.swagger.generator.core.AbstractSwaggerGenerator.scanMethods(AbstractSwaggerGenerator.java:297) ~[swagger-generator-core-2.1.3.jar:2.1.3]
   	... 21 common frames omitted
   
   
   Process finished with exit code 1
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2139: @RequestBody 启动报错2.x

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2139:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2139#issuecomment-747148745


   [升级指南](https://docs.servicecomb.io/java-chassis/zh_CN/featured-topics/upgrading/1_3_0T2_0_0/)  有说明这个问题


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2139: @RequestBody 启动报错2.x

Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #2139:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2139#issuecomment-746413300


   ```
   Caused by: java.lang.IllegalStateException: parameter name is not present, method=org.example.controller.HelloController:result
   solution:
   change pom.xml, add compiler argument: -parameter
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] myVictor closed issue #2139: @RequestBody 启动报错2.x

Posted by GitBox <gi...@apache.org>.
myVictor closed issue #2139:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2139


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2139: @RequestBody 启动报错2.x

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2139:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2139#issuecomment-746011264


   可能是 StudentVo 或者 StudentVo  存在抽象类和接口, 需要看下你的详细错误。 [类型支持说明参考](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/interface-constraints/), 可以先了解下和 spring boot的差异。 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org