Uploaded image for project: 'Apache ServiceComb'
  1. Apache ServiceComb
  2. SCB-1795

when use query object, sdk don't support fluent setter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • java-chassis-2.0.1
    • Java-Chassis
    • None

    Description

      public class Person {
          private String name;
      
          public String getName() {
              return name;
          }
      
          public Person setName(String name) {
              this.name = name;
              return this;
          }
      }
      //provider
        @RequestMapping(value = "/test", method = RequestMethod.GET)
        public void queryEvents(Person person) {
          System.out.println(person);
        }
      
      

      error:

      Caused by: java.lang.IllegalStateException: Failed to create lambda from public org.apache.servicecomb.demo.springmvc.server.Person org.apache.servicecomb.demo.springmvc.server.Person.setRkdName(java.lang.String)
      	at org.apache.servicecomb.foundation.common.utils.LambdaMetafactoryUtils.createLambda(LambdaMetafactoryUtils.java:139)
      	at org.apache.servicecomb.swagger.invocation.arguments.producer.ProducerArgumentsMapperCreator.processBeanParameter(ProducerArgumentsMapperCreator.java:117)
      	at org.apache.servicecomb.swagger.invocation.arguments.AbstractArgumentsMapperCreator.doCreateArgumentsMapper(AbstractArgumentsMapperCreator.java:179)
      	at org.apache.servicecomb.swagger.invocation.arguments.producer.ProducerArgumentsMapperCreator.createArgumentsMapper(ProducerArgumentsMapperCreator.java:60)
      	at org.apache.servicecomb.swagger.engine.SwaggerEnvironment.createProducer(SwaggerEnvironment.java:142)
      	at org.apache.servicecomb.core.provider.producer.ProducerProviderManager.registerSchema(ProducerProviderManager.java:93)
      	at org.apache.servicecomb.core.provider.producer.ProducerProviderManager.regsiterProducerMetas(ProducerProviderManager.java:82)
      	at org.apache.servicecomb.core.provider.producer.ProducerProviderManager.init(ProducerProviderManager.java:68)
      	at org.apache.servicecomb.core.SCBEngine.doRun(SCBEngine.java:342)
      	at org.apache.servicecomb.core.SCBEngine.run(SCBEngine.java:297)
      	... 13 more
      Caused by: java.lang.invoke.LambdaConversionException: Type mismatch for lambda expected return: class org.apache.servicecomb.demo.springmvc.server.Person is not convertible to void
      	at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:286)
      	at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303)
      	at org.apache.servicecomb.foundation.common.utils.LambdaMetafactoryUtils.createLambda(LambdaMetafactoryUtils.java:129)
      	... 22 more
      

      Attachments

        Issue Links

          Activity

            People

              china_rkd 何一乐
              china_rkd 何一乐
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m