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 2022/12/27 02:16:36 UTC

[GitHub] [servicecomb-java-chassis] myVictor opened a new issue, #3546: 微服务简调用报错

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

   java-chassis版本:2.8.3
   
   提供方代码如下:
   
   调用方代码:
   ![image](https://user-images.githubusercontent.com/7285684/209600444-6b229a80-9817-426a-a9d1-e9f331f4a564.png)
   
   报错信息:
   
   org.apache.servicecomb.swagger.invocation.exception.InvocationException: InvocationException: code=400;msg={message=Parameter is not valid for operation [captcha.com.cxisoft.captcha.controller.CaptchaController.checkCaptcha]. **Parameter is [checkVo]. Processor is [body].}**
   	at org.apache.servicecomb.swagger.invocation.exception.ExceptionFactory.doCreate(ExceptionFactory.java:76)
   	at org.apache.servicecomb.swagger.invocation.exception.ExceptionFactory.create(ExceptionFactory.java:63)
   	at org.apache.servicecomb.swagger.invocation.Response.create(Response.java:137)
   	at org.apache.servicecomb.transport.rest.client.http.DefaultHttpClientFilter.extractResponse(DefaultHttpClientFilter.java:106)
   	at org.apache.servicecomb.transport.rest.client.http.DefaultHttpClientFilter.afterReceiveResponse(DefaultHttpClientFilter.java:134)
   	at org.apache.servicecomb.transport.rest.client.http.RestClientInvocation.lambda$processResponseBody$7(RestClientInvocation.java:246)
   	at org.apache.servicecomb.core.provider.consumer.SyncResponseExecutor.waitResponse(SyncResponseExecutor.java:62)
   	at org.apache.servicecomb.core.provider.consumer.InvokerUtils.innerSyncInvokeImpl(InvokerUtils.java:210)
   	at org.apache.servicecomb.core.provider.consumer.InvokerUtils.lambda$decorateSyncRetry$cf34ec48$2(InvokerUtils.java:263)
   	at io.github.resilience4j.retry.Retry.lambda$decorateCheckedSupplier$3f69f149$1(Retry.java:137)
   	at io.vavr.control.Try.of(Try.java:75)
   	at org.apache.servicecomb.core.provider.consumer.InvokerUtils.decorateSyncRetry(InvokerUtils.java:264)
   	at org.apache.servicecomb.core.provider.consumer.InvokerUtils.innerSyncInvoke(InvokerUtils.java:195)
   	at org.apache.servicecomb.provider.springmvc.reference.CseClientHttpRequest.doInvoke(CseClientHttpRequest.java:244)
   	at org.apache.servicecomb.provider.springmvc.reference.CseClientHttpRequest.invoke(CseClientHttpRequest.java:234)
   	at org.apache.servicecomb.provider.springmvc.reference.CseClientHttpRequest.execute(CseClientHttpRequest.java:176)
   	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:776)
   	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
   	at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:468)
   	at org.apache.servicecomb.provider.springmvc.reference.RestTemplateWrapper.postForEntity(RestTemplateWrapper.java:130)
   	at com.cxisoft.oauth2.filter.MyLoginFilter.handLogin(MyLoginFilter.java:139)
   	at com.cxisoft.oauth2.filter.MyLoginFilter.doFilter(MyLoginFilter.java:73)
   	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
   	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
   	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
   	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
   	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
   	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
   	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
   	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
   	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
   	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
   	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
   	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
   	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
   	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
   	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
   	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
   	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
   	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
   	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
   	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
   	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
   	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
   	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
   	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
   	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
   	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
   	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
   	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
   	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
   	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
   	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
   	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
   	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
   	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   	at java.lang.Thread.run(Thread.java:745)
   
   
   搞不懂是啥原因?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org.apache.org

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


[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3546: 微服务简调用报错

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

   直接写死地址的情况下,走的不是 java chassis流程, 是 Spring MVC提供的 RestTemplate。 可以试试将请求的 body值从 String.class 改为 CheckVo 试试。 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] myVictor commented on issue #3546: 微服务简调用报错

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

   > 可以看下provider的日志, 应该会比较详细。 应该是客户端代码写错了, body应该是 CheckVo, 使用的是 String 。
   
   好像不是客户端的问题,我直接写死服务地址调用是通的(vo是对象和字符串都通,写ces地址字符串和对象都报错)。 
   ![image](https://user-images.githubusercontent.com/7285684/209613668-61b2b3b2-d010-48ed-80ab-bd4907c9e8ab.png)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3546: 微服务简调用报错

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

   可以看下provider的日志, 应该会比较详细。 应该是客户端代码写错了, body应该是 CheckVo, 使用的是 String 。 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] myVictor commented on issue #3546: 微服务简调用报错

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

   > > > 
   > > 
   > > 
   > > 改成对象方式传递了,还是同样的报错信息
   > 
   > ![image](https://user-images.githubusercontent.com/7285684/209638307-b8058113-8b84-4593-a1b3-ec4225e822f3.png)
   
   InvocationException: code=400;msg={message=Parameter is not valid for operation [captcha.com.cxisoft.captcha.controller.CaptchaController.checkCaptcha]. Parameter is [checkVo]. Processor is [body].}


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] myVictor commented on issue #3546: 微服务简调用报错

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

   ![image](https://user-images.githubusercontent.com/7285684/209600686-c2dde18b-ca70-495b-bdc8-d9d552206104.png)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] myVictor commented on issue #3546: 微服务简调用报错

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

   > 
   
   改成对象方式传递了,还是同样的报错信息


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] myVictor commented on issue #3546: 微服务简调用报错

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

   > > 
   > 
   > 改成对象方式传递了,还是同样的报错信息
   
   ![image](https://user-images.githubusercontent.com/7285684/209638307-b8058113-8b84-4593-a1b3-ec4225e822f3.png)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] myVictor closed issue #3546: 微服务简调用报错

Posted by "myVictor (via GitHub)" <gi...@apache.org>.
myVictor closed issue #3546: 微服务简调用报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/3546


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3546: 微服务简调用报错

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

   比较奇怪,你可以看下服务端的日志。 详细日志可以参考下 `RestCodec` 里面如何打印的, 可能没打全,需要个配置开关。 
   
   ```
         } catch (Exception e) {
           // Avoid information leak of user input, and add option for debug use.
           String message = String
               .format("Parameter is not valid for operation [%s]. Parameter is [%s]. Processor is [%s].",
                   restOperation.getOperationMeta().getMicroserviceQualifiedName(),
                   param.getParamName(),
                   param.getParamProcessor().getProcessorType());
           if (DynamicPropertyFactory.getInstance().getBooleanProperty(
               RestConst.PRINT_CODEC_ERROR_MESSGAGE, false).get()) {
             LOG.error(message, e);
           } else {
             LOG.error("{} Add {}=true to print the details.", message, RestConst.PRINT_CODEC_ERROR_MESSGAGE);
           }
           throw new InvocationException(Status.BAD_REQUEST, message);
         }
       }
   ```


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3546: 微服务简调用报错

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

   `CheckVO` 服务端和客户端的类型字段定义不一样?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] myVictor commented on issue #3546: 微服务简调用报错

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

   > 
   
   2022-12-27  17:54:37.529 [group1-2-thread-1] ERROR org.apache.servicecomb.common.rest.codec.RestCodec - Parameter is not valid for operation [captcha.myCaptcha.checkCaptcha]. Parameter is [checkVo]. Processor is [body].
   com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.util.Date` from String "2022-12-27T09:54:35.000+00:00": not a valid representation (error: Failed to parse Date value '2022-12-27T09:54:35.000+00:00': Unparseable date: "2022-12-27T09:54:35.000+00:00")
    at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 1, column: 164] (through reference chain: com.cxisoft.captcha.vo.CheckVo["imageCaptchaTrack"]->cloud.tianai.captcha.validator.common.model.dto.ImageCaptchaTrack["startSlidingTime"])
   	at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)
   	at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1996)
   	at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:1224)
   	at com.fasterxml.jackson.databind.deser.std.StdDeserializer._parseDate(StdDeserializer.java:1362)
   	at com.fasterxml.jackson.databind.deser.std.StdDeserializer._parseDate(StdDeserializer.java:1304)
   	at com.fasterxml.jackson.databind.deser.std.DateDeserializers$DateBasedDeserializer._parseDate(DateDeserializers.java:201)
   	at com.fasterxml.jackson.databind.deser.std.DateDeserializers$DateDeserializer.deserialize(DateDeserializers.java:303)
   	at com.fasterxml.jackson.databind.deser.std.DateDeserializers$DateDeserializer.deserialize(DateDeserializers.java:281)
   	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
   	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:392)
   	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
   	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
   	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:392)
   	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
   	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
   	at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2105)
   	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1481)
   	at org.apache.servicecomb.common.rest.codec.param.BodyProcessorCreator$BodyProcessor.getValueImpl(BodyProcessorCreator.java:144)
   	at org.apache.servicecomb.common.rest.codec.param.BodyProcessorCreator$BodyProcessor.getValue(BodyProcessorCreator.java:103)
   	at org.apache.servicecomb.common.rest.codec.RestCodec.restToArgs(RestCodec.java:62)
   	at org.apache.servicecomb.common.rest.filter.inner.ServerRestArgsFilter.afterReceiveRequest(ServerRestArgsFilter.java:62)
   	at org.apache.servicecomb.common.rest.AbstractRestInvocation.prepareInvoke(AbstractRestInvocation.java:281)
   	at org.apache.servicecomb.common.rest.AbstractRestInvocation.invoke(AbstractRestInvocation.java:258)
   	at org.apache.servicecomb.common.rest.AbstractRestInvocation.runOnExecutor(AbstractRestInvocation.java:248)
   	at org.apache.servicecomb.common.rest.AbstractRestInvocation.lambda$scheduleInvocation$2(AbstractRestInvocation.java:204)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   	at java.lang.Thread.run(Thread.java:745)
   时间格式不对,这报错信息就不精准了


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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