You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Javassist reports an error when encountering duplicate method: "duplicate method".
When I change default implementation of the proxy to Bytebuddy, the service starts successfully.
Expected behavior
Duplicate methods should only generate one method.
Actual behavior
Exception in thread "main" com.alipay.sofa.rpc.core.exception.SofaRpcRuntimeException: RPC-010080001: 使用 [javassist] 构造代理出现错误.
at com.alipay.sofa.rpc.proxy.javassist.JavassistProxy.getProxy(JavassistProxy.java:149)
at com.alipay.sofa.rpc.proxy.ProxyFactory.buildProxy(ProxyFactory.java:50)
at com.alipay.sofa.rpc.bootstrap.DefaultConsumerBootstrap.refer(DefaultConsumerBootstrap.java:156)
at com.alipay.sofa.rpc.config.ConsumerConfig.refer(ConsumerConfig.java:955)
at me.s2marine.QuickStartClient.main(QuickStartClient.java:14)
Caused by: javassist.bytecode.DuplicateMemberException: duplicate method: getType in me.s2marine.QuickStartClient$HelloService_proxy_0
at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:685)
at javassist.bytecode.ClassFile.addMethod(ClassFile.java:660)
at javassist.CtClassType.addMethod(CtClassType.java:1498)
at com.alipay.sofa.rpc.proxy.javassist.JavassistProxy.getProxy(JavassistProxy.java:125)
... 4 more
Steps to reproduce
Minimal yet complete reproducer code (or GitHub URL to code)
publicclassQuickStartClient {
publicstaticvoidmain(String[] args) {
ConsumerConfig<HelloService> consumerConfig = newConsumerConfig<HelloService>()
.setInterfaceId(HelloService.class.getName()) // Specify the interface
.setProtocol("bolt") // Specify the protocol.setDirectUrl
.setDirectUrl("bolt://127.0.0.1:12200"); // Specify the direct connection address// Generate the proxy classHelloServicehelloService = consumerConfig.refer();
}
publicinterfaceHelloServiceextendsSubInterface1, SubInterface2 {
StringsayHello(Stringstring);
}
interfaceSubInterface1 {
StringgetType();
StringsomeMethod1();
}
interfaceSubInterface2 {
StringgetType();
StringsomeMethod2();
}
}
Environment
SOFARPC version: 5.11.1
JVM version (e.g. java -version): 1.8.0_392
OS version (e.g. uname -a): Linux archlinux-r9000p-s2marine 6.6.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000 x86_64 GNU/Linux
Maven version: Apache Maven 3.8.7
IDE version: Intellij IDEA 2023.3.2
The text was updated successfully, but these errors were encountered:
@s2marine Thank you for your feedback. This issue does indeed exist here. One solution is to do logical deduplication in the method com.alipay.sofa.rpc.proxy.javassist.JavassistProxy#createMethod.If you'd like to fix it, welcome to take part in contributing.
Describe the bug
Javassist reports an error when encountering duplicate method: "duplicate method".
When I change default implementation of the proxy to Bytebuddy, the service starts successfully.
Expected behavior
Duplicate methods should only generate one method.
Actual behavior
Steps to reproduce
Minimal yet complete reproducer code (or GitHub URL to code)
Environment
java -version
): 1.8.0_392uname -a
):Linux archlinux-r9000p-s2marine 6.6.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: