weibocom / motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Other
5.88k stars 1.78k forks source link

包装了@MotanReferer 依然不可以注入,显示null #684

Open richwxd opened 6 years ago

richwxd commented 6 years ago

差不多的写法,dubbo可以,motan不可以。dubbo支持直接注入spring 上下文,motan为什么失败了呢。 class MyClient { @MotanReferer(basicReferer = "refererConfig") private RemoteService remoteService; .... }

其他配置按demo修改的。就是注入不可以

sunnights commented 6 years ago

可以参考https://github.com/weibocom/motan/wiki/zh_quickstart#使用注解方式配置motan

lhl4546 commented 6 years ago

猜测你少写了motan.annotation.package,你需要告诉AnnotationBean扫描哪些package,因为@MotanReferer是motan自定义注解,需要显式通知motan处理