hwding opened a new issue, #13436: URL: https://github.com/apache/dubbo/issues/13436
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy --> - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. ### Environment * Dubbo version: `3.2.7` * Operating System version: `Linux 4.19.91-009.ali4000.alios7.x86_64 #1 SMP Mon Jan 25 10:47:38 CST 2021 x86_64 x86_64 x86_64 GNU/Linux` * Java version: `OpenJDK Runtime Environment (Alibaba 8.4.7) (build 1.8.0_152-b187) OpenJDK 64-Bit Server VM (Alibaba 8.4.7) (build 25.152-b187, mixed mode)` ### Steps to reproduce this issue 1. define generic reference config ```java referenceConfig.setGeneric("true"); referenceConfig.setAsync(false); genericService = referenceConfig.get(); ``` 2. do invocation ```java // argTypes contain remote-defined-only class genericService.$invoke(method, argTypes, args); ``` Pls. provide [GitHub address] to reproduce this issue. ### Expected Behavior Succeed in invoking remote service in generic mode. ### Actual Behavior Failed to invoke remote in generic mode, exception occurred in client side. ```text Caused by: org.apache.dubbo.rpc.StatusRpcException: INTERNAL : Call aborted cause client exception at org.apache.dubbo.rpc.TriRpcStatus.asException(TriRpcStatus.java:214) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.rpc.protocol.tri.TripleInvoker.doInvoke(TripleInvoker.java:166) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.rpc.protocol.AbstractInvoker.doInvokeAndReturn(AbstractInvoker.java:243) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:187) ~[dubbo-3.2.7.jar:3.2.7] ... 295 common frames omitted Caused by: java.lang.IllegalStateException: Not found class com.***.***DTO, cause: com.***.***DTO at org.apache.dubbo.common.utils.ReflectUtils.forName(ReflectUtils.java:685) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.rpc.support.RpcUtils.getParameterTypes(RpcUtils.java:169) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.rpc.protocol.tri.TripleInvoker.invokeUnary(TripleInvoker.java:251) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.rpc.protocol.tri.TripleInvoker.doInvoke(TripleInvoker.java:150) ~[dubbo-3.2.7.jar:3.2.7] ... 297 common frames omitted Caused by: java.lang.ClassNotFoundException: com.***.***DTO at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:72) ~[spring-boot-2.5.12.jar:2.5.12] at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1215) ~[tomcat-embed-core-9.0.60.jar:9.0.60] at java.lang.Class.forName0(Native Method) ~[na:1.8.0_152] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_152] at org.apache.dubbo.common.utils.ReflectUtils.name2class(ReflectUtils.java:786) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.common.utils.ReflectUtils.name2class(ReflectUtils.java:706) ~[dubbo-3.2.7.jar:3.2.7] at org.apache.dubbo.common.utils.ReflectUtils.forName(ReflectUtils.java:683) ~[dubbo-3.2.7.jar:3.2.7] ... 300 common frames omitted ``` ### Cause `org.apache.dubbo.rpc.protocol.tri.TripleInvoker#invokeUnary` When method descriptor in generic, it tries to find remote-defined-only in client side, which causes the `ClassNotFoundException`. ```java if (methodDescriptor instanceof StubMethodDescriptor) { pureArgument = invocation.getArguments()[0]; } else { if (methodDescriptor.isGeneric()) { Object[] args = new Object[3]; args[0] = RpcUtils.getMethodName(invocation); // here args[1] = Arrays.stream(RpcUtils.getParameterTypes(invocation)).map(Class::getName).toArray(String[]::new); args[2] = RpcUtils.getArguments(invocation); pureArgument = args; } else { pureArgument = invocation.getArguments(); } } ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
