Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip static method in interface when creating proxy. #4336

Closed
chickenlj opened this issue Jun 18, 2019 · 1 comment
Closed

Skip static method in interface when creating proxy. #4336

chickenlj opened this issue Jun 18, 2019 · 1 comment
Assignees
Milestone

Comments

@chickenlj
Copy link
Contributor

[18/06/19 16:06:03:822 CST] main ERROR support.ServiceOrientedRegistry:  [DUBBO] [source error] not available in a static method: handler, dubbo version: , current host: 30.5.121.48
java.lang.RuntimeException: [source error] not available in a static method: handler
	at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:348)
	at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:287)
	at org.apache.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:192)
	at org.apache.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:66)
	at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:35)
	at org.apache.dubbo.rpc.proxy.AbstractProxyFactory.getProxy(AbstractProxyFactory.java:68)
	at org.apache.dubbo.rpc.proxy.AbstractProxyFactory.getProxy(AbstractProxyFactory.java:37)
	at org.apache.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper.getProxy(StubProxyFactoryWrapper.java:72)
	at org.apache.dubbo.rpc.ProxyFactory$Adaptive.getProxy(ProxyFactory$Adaptive.java)
	at org.apache.dubbo.registry.client.metadata.proxy.DefaultMetadataServiceProxyFactory.createProxy(DefaultMetadataServiceProxyFactory.java:71)
	at org.apache.dubbo.registry.client.metadata.proxy.DefaultMetadataServiceProxyFactory.lambda$getProxy$0(DefaultMetadataServiceProxyFactory.java:61)
	at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
	at org.apache.dubbo.registry.client.metadata.proxy.DefaultMetadataServiceProxyFactory.getProxy(DefaultMetadataServiceProxyFactory.java:61)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.getProviderExportedURLs(ServiceOrientedRegistry.java:403)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.getTemplateURLs(ServiceOrientedRegistry.java:377)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.getSubscribedURLs(ServiceOrientedRegistry.java:253)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.subscribeURLs(ServiceOrientedRegistry.java:228)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.subscribeURLs(ServiceOrientedRegistry.java:212)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.lambda$subscribeURLs$0(ServiceOrientedRegistry.java:204)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.subscribeURLs(ServiceOrientedRegistry.java:204)
	at org.apache.dubbo.registry.support.ServiceOrientedRegistry.doSubscribe(ServiceOrientedRegistry.java:178)
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:295)
	at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:172)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:410)
	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:391)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:69)
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:128)
	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:414)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:345)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:261)
	at org.apache.dubbo.bootstrap.DubboServiceConsumerBootstrap.main(DubboServiceConsumerBootstrap.java:50)
Caused by: javassist.CannotCompileException: [source error] not available in a static method: handler
	at javassist.CtNewMethod.make(CtNewMethod.java:79)
	at javassist.CtNewMethod.make(CtNewMethod.java:45)
	at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:323)
	... 33 more
Caused by: compile error: not available in a static method: handler
	at javassist.compiler.MemberCodeGen.fieldAccess(MemberCodeGen.java:1037)
	at javassist.compiler.MemberCodeGen.atFieldRead(MemberCodeGen.java:867)
	at javassist.compiler.MemberCodeGen.atMember(MemberCodeGen.java:862)
	at javassist.compiler.JvstCodeGen.atMember(JvstCodeGen.java:112)
	at javassist.compiler.ast.Member.accept(Member.java:39)
	at javassist.compiler.MemberCodeGen.atCallExpr(MemberCodeGen.java:510)
	at javassist.compiler.JvstCodeGen.atCallExpr(JvstCodeGen.java:244)
	at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
	at javassist.compiler.CodeGen.atAssignCore(CodeGen.java:877)
	at javassist.compiler.CodeGen.atVariableAssign(CodeGen.java:810)
	at javassist.compiler.CodeGen.atDeclarator(CodeGen.java:744)
	at javassist.compiler.ast.Declarator.accept(Declarator.java:100)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:292)
	at javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:274)
	at javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:44)
	at javassist.compiler.Javac.compileMethod(Javac.java:169)
	at javassist.compiler.Javac.compile(Javac.java:95)
	at javassist.CtNewMethod.make(CtNewMethod.java:74)
	... 35 more
public java.lang.String version(){Object[] args = new Object[0]; Object ret = handler.invoke(this, methods[0], args); return (java.lang.String)ret;}

public java.lang.String serviceName(){Object[] args = new Object[0]; Object ret = handler.invoke(this, methods[1], args); return (java.lang.String)ret;}

public static java.util.List toURLs(java.lang.Iterable arg0){Object[] args = new Object[1]; args[0] = (w)1; Object ret = handler.invoke(this, methods[2], args); return (java.util.List)ret;}
@cvictory
Copy link
Contributor

cvictory commented Sep 4, 2019

It will be fixed in 2.7.5 that is merged from cloud-native branch.

@chickenlj chickenlj modified the milestones: 2.7.5, 2.7.6 Dec 30, 2019
@cvictory cvictory closed this as completed Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants