You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/15 12:05:52 UTC

[GitHub] [dubbo] freegaga opened a new issue, #10165: dubbo泛化调用异常

freegaga opened a new issue, #10165:
URL: https://github.com/apache/dubbo/issues/10165

   
   ### Environment
   
   * Dubbo version: 2.7.12
   * Operating System version: windos10
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   ReferenceConfig<GenericService> reference = new ReferenceConfig();
           reference.setInterface("com.**.**.**");
           reference.setGroup(group);
           reference.setVersion(version);
           reference.setRetries(retryTime);
   
           RpcContext.getContext().setAttachment("generic", "gson");
           reference.setGeneric(true);
           reference.setCheck(false);
           reference.setTimeout(100000);
   
           GenericService genericService = ReferenceConfigCache.getCache().get(reference);
           Map<String, Object> result = (Map<String, Object>) genericService.$invoke(method, new String[]{param.getClass().getName()}, new Object[]{JSONObject.toJSONString(param)});
           
   上面是泛化调用代码
   
   1,系统启动第一次通过泛化调用dubbo服务会报如下错误,但是第二次调dubbo服务就正常了。
   2,我尝试过在调用dubbo服务的地方发生异常时捕获异常在重试也不行
   
   
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   
   
   If there is an exception, please attach the exception trace:
   
   ```
   org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.alibaba.dubbo.rpc.service.GenericException: java.lang.ClassCastException: java.lang.String cannot be cast to com.cloud.hub.dto.Command
   java.lang.ClassCastException: java.lang.String cannot be cast to com.cloud.hub.dto.Command
   	at org.apache.dubbo.common.bytecode.Wrapper3.invokeMethod(Wrapper3.java)
   	at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
   	at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:84)
   	at org.apache.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:56)
   	at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
   	at org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:77)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:46)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:91)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:52)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:184)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:129)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:146)
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100)
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175)
   	at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
   	at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
   	at java.lang.Thread.run(Thread.java:750)
   
   	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-5.3.8.jar:5.3.8]
   	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.8.jar:5.3.8]
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) ~[jakarta.servlet-api-4.0.4.jar:4.0.4]
   	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.8.jar:5.3.8]
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:584) ~[jakarta.servlet-api-4.0.4.jar:4.0.4]
   	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at com.github.xiaoymin.knife4j.spring.filter.SecurityBasicAuthFilter.doFilter(SecurityBasicAuthFilter.java:90) ~[knife4j-spring-1.9.6.jar:na]
   	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at com.github.xiaoymin.knife4j.spring.filter.ProductionSecurityFilter.doFilter(ProductionSecurityFilter.java:53) ~[knife4j-spring-1.9.6.jar:na]
   	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.8.jar:5.3.8]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar:5.3.8]
   	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.8.jar:5.3.8]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar:5.3.8]
   	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar:5.3.8]
   	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.8.jar:5.3.8]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar:5.3.8]
   	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) ~[undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) [undertow-servlet-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) [undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:841) [undertow-core-2.2.8.Final.jar:2.2.8.Final]
   	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) [jboss-threads-3.1.0.Final.jar:3.1.0.Final]
   	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019) [jboss-threads-3.1.0.Final.jar:3.1.0.Final]
   	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558) [jboss-threads-3.1.0.Final.jar:3.1.0.Final]
   	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1423) [jboss-threads-3.1.0.Final.jar:3.1.0.Final]
   	at java.lang.Thread.run(Thread.java:750) [na:1.8.0_322]
   Caused by: com.alibaba.dubbo.rpc.service.GenericException: java.lang.ClassCastException: java.lang.String cannot be cast to com.cloud.hub.dto.Command
   java.lang.ClassCastException: java.lang.String cannot be cast to com.cloud.hub.dto.Command
   	at org.apache.dubbo.common.bytecode.Wrapper3.invokeMethod(Wrapper3.java)
   	at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
   	at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:84)
   	at org.apache.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:56)
   	at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
   	at org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:77)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:46)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:91)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:52)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:184)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:129)
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61)
   	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:146)
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100)
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175)
   	at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
   	at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
   	at java.lang.Thread.run(Thread.java:750)
   
   	at org.apache.dubbo.rpc.filter.GenericFilter.onResponse(GenericFilter.java:224) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.protocol.FilterNode.lambda$invoke$0(FilterNode.java:99) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.AsyncRpcResult.lambda$whenCompleteWithContext$0(AsyncRpcResult.java:197) ~[dubbo-2.7.12.jar:2.7.12]
   	at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774) ~[na:1.8.0_322]
   	at java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:792) ~[na:1.8.0_322]
   	at java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2153) ~[na:1.8.0_322]
   	at org.apache.dubbo.rpc.AsyncRpcResult.whenCompleteWithContext(AsyncRpcResult.java:195) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:81) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:129) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:61) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:146) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) ~[dubbo-2.7.12.jar:2.7.12]
   	at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57) ~[dubbo-2.7.12.jar:2.7.12]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_322]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_322]
   	at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41) ~[dubbo-2.7.12.jar:2.7.12]
   	... 1 common frames omitted
   ```
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1156422853

   `com.cloud.hub.dto.Command` 这个参数是入参还是出参


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1235032187

   因为你传的参数值是 Json 格式的
   
   >     Map<String, Object> result = (Map<String, Object>) genericService.$invoke(method, new String[]{param.getClass().getName()}, new Object[]{JSONObject.toJSONString(param)});
   
   
   
   这个方法也尝试下 reference.setGeneric("gson"); 或者 reference.setGeneric("json");


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1168646815

   wrapper.invokeMethod 是调用 proxy(服务端实现对象)的指定方法


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] freegaga commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
freegaga commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1157132750

   > 
   
   这个是入参


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1169445952

   > ## 这里面是请求的业务实现的,你可以查一下你的服务端实现是不是有问题
   > @AlbumenJ 我查了下服务端没有什么问题, 现在我是通过如下方法解决的。但是这种方法不是很好。
   > 
   > AtomicBoolean flag = flagMap.get(group); if(null == flag || !flag.get()){//第一次调用 result = (Map<String, Object>) genericService.$invoke(method, new String[]{param.getClass().getName()}, new Object[]{PojoUtils.generalize(param)}); flag = new AtomicBoolean(true); flagMap.put(group,flag); }else{//非第一次调用 result = (Map<String, Object>) genericService.$invoke(method, new String[]{param.getClass().getName()}, new Object[]{JSONObject.toJSONString(param)}); }
   
   你在服务端打断点,第一次请求到 `wrapper.invokeMethod` 的时候看下是不是抛异常了,如果是的话再去业务代码里面打断点


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] twz007 commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
twz007 commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1157321826

   reference.setGeneric("gson");
   还有问题的话,可以在provider侧断点调试:org.apache.dubbo.rpc.filter.GenericFilter#invoke  @freegaga 


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] freegaga commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
freegaga commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1157134765

   com.cloud.hub.dto.Command  这个参数是入参还是出参
   ---------------------------------------------------------------------
   这个是入参,伪代码如下
   @Override
       public Res<JSONObject> command(Command command) {
           JSONObject  param = new JSONObject();
            @param.put("key","test");
           return Res.data(param);
       }


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] freegaga commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
freegaga commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1160395802

   ![image](https://user-images.githubusercontent.com/3883951/174601204-29031858-b068-453e-ada8-224ca82fa1b7.png)
   
   感觉是这里的问题
   ![image](https://user-images.githubusercontent.com/3883951/174601487-3eb4a287-2d68-4626-8990-a7cf1ba5369f.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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1168646107

   这里面是请求的业务实现的,你可以查一下你的服务端实现是不是有问题


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] freegaga commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
freegaga commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1168687053

   这里面是请求的业务实现的,你可以查一下你的服务端实现是不是有问题
   ------------------------------------------------------------------------------------
   @AlbumenJ 
   我查了下服务端没有什么问题,
   现在我是通过如下方法解决的。但是这种方法不是很好,
   `
   AtomicBoolean flag = flagMap.get(group);
           if(null == flag || !flag.get()){//第一次调用
               result = (Map<String, Object>) genericService.$invoke(method, new String[]{param.getClass().getName()}, new Object[]{PojoUtils.generalize(param)});
               flag = new AtomicBoolean(true);
               flagMap.put(group,flag);
           }else{//非第一次调用
               result = (Map<String, Object>) genericService.$invoke(method, new String[]{param.getClass().getName()}, new Object[]{JSONObject.toJSONString(param)});
           }
   `


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj closed issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
chickenlj closed issue #10165: dubbo泛化调用异常
URL: https://github.com/apache/dubbo/issues/10165


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] freegaga commented on issue #10165: dubbo泛化调用异常

Posted by GitBox <gi...@apache.org>.
freegaga commented on issue #10165:
URL: https://github.com/apache/dubbo/issues/10165#issuecomment-1157134953

   com.cloud.hub.dto.Command  这个参数是入参还是出参
   ---------------------------------------------------------------------
   这个是入参,伪代码如下
   @Override
       public Res<JSONObject> command(Command command) {
           JSONObject  param = new JSONObject();
            @param.put("key","test");
           return Res.data(param);
       }


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org