Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.1

Operating System version: Win10

Java version: 1.8

Steps to reproduce this issue

maven project dependency include artifactId(dubbo-filter-cache)

Start a Provider service

Expected Result

The program start without errors

Actual Result

适配CacheFactory代码编译失败：

Adaptive code is generate by class "org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator", that it make an error method adaptive code.

If there is an exception, please attach the exception trace:

2019-04-22 17:54:24.754 [main] ERROR org.apache.dubbo.common.extension.ExtensionLoader - [DUBBO] Failed to inject via method setCacheFactory of interface org.apache.dubbo.rpc.Filter: Failed to create adaptive instance: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.cache.CacheFactory, cause: Failed to compile class, cause: [source error] no such field: invocation, class: org.apache.dubbo.cache.CacheFactory$Adaptive, code:
package org.apache.dubbo.cache;
import org.apache.dubbo.common.extension.ExtensionLoader;
public class CacheFactory$Adaptive implements org.apache.dubbo.cache.CacheFactory {
public org.apache.dubbo.cache.Cache getCache(org.apache.dubbo.common.URL arg0, org.apache.dubbo.rpc.Invocation arg1) {
if (arg0 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg0;
if (arg1 == null) throw new IllegalArgumentException("invocation == null"); String methodName = arg1.getMethodName();
String extName = url.getMethodParameter(methodName, "cache", "lru");
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.cache.CacheFactory) name from url (" + url.toString() + ") use keys([cache])");
org.apache.dubbo.cache.CacheFactory extension = (org.apache.dubbo.cache.CacheFactory)ExtensionLoader.getExtensionLoader(org.apache.dubbo.cache.CacheFactory.class).getExtension(extName);
return extension.getCache(url, invocation);
}
}
, stack: javassist.CannotCompileException: [source error] no such field: invocation

javassist.CannotCompileException: [source error] no such field: invocation
at javassist.CtNewMethod.make(CtNewMethod.java:79)
at javassist.CtNewMethod.make(CtNewMethod.java:45)
at org.apache.dubbo.common.compiler.support.CtClassBuilder.build(CtClassBuilder.java:168)
at org.apache.dubbo.common.compiler.support.JavassistCompiler.doCompile(JavassistCompiler.java:82)
at org.apache.dubbo.common.compiler.support.AbstractCompiler.compile(AbstractCompiler.java:59)
at org.apache.dubbo.common.compiler.support.AdaptiveCompiler.compile(AdaptiveCompiler.java:45)
at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:859)
at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:852)
at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:841)
at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:478)
at org.apache.dubbo.common.extension.factory.SpiExtensionFactory.getExtension(SpiExtensionFactory.java:33)
at org.apache.dubbo.common.extension.factory.AdaptiveExtensionFactory.getExtension(AdaptiveExtensionFactory.java:47)
at org.apache.dubbo.common.extension.ExtensionLoader.injectExtension(ExtensionLoader.java:562)
at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:531)
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:347)
at org.apache.dubbo.common.extension.ExtensionLoader.getActivateExtension(ExtensionLoader.java:225)
at org.apache.dubbo.common.extension.ExtensionLoader.getActivateExtension(ExtensionLoader.java:192)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.buildInvokerChain(ProtocolFilterWrapper.java:49)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:108)
at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$2(RegistryProtocol.java:220)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:218)
at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:184)
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:55)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:106)
at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:559)
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:417)
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:375)
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:337)
at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:319)
at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:113)
at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:1)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
at com.ccesun.rhpf.regi.provider.RmiEnvInitServiceTest.testServiceStart(RmiEnvInitServiceTest.java:28)
at com.ccesun.rhpf.regi.provider.RmiEnvInitServiceTest.main(RmiEnvInitServiceTest.java:41)
Caused by: compile error: no such field: invocation
at javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:845)
at javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:803)
at javassist.compiler.TypeChecker.atMember(TypeChecker.java:988)
at javassist.compiler.JvstTypeChecker.atMember(JvstTypeChecker.java:66)
at javassist.compiler.ast.Member.accept(Member.java:39)
at javassist.compiler.JvstTypeChecker.atMethodArgs(JvstTypeChecker.java:221)
at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:735)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:695)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
at javassist.compiler.CodeGen.compileExpr(CodeGen.java:229)
at javassist.compiler.CodeGen.atReturnStmnt2(CodeGen.java:615)
at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:425)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:363)
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)
... 44 more

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.5.3

Operating System version: Linux version 2.6.32-573.22.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 23 03:35:39 UTC 2016

Java version: java version "1.8.0_162"

Steps to reproduce this issue

call api throw null exception

What actually happens?

If there is an exception, please attach the exception trace:

java.lang.NullPointerExceptionat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:423)at com.alibaba.com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:271)at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:155)at com.alibaba.com.caucho.hessian.io.SerializerFactory.readObject(SerializerFactory.java:397)at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2070)at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2005)at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1990)at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:88)at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:92)at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:109)at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:97)at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:126)at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:87)at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:46)at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalDecoder.messageReceived(NettyCodecAdapter.java:134)at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at java.lang.Thread.run(Thread.java:748)