Closed liangyd1024 closed 6 years ago
遇到同样的问题,,请问解决了吗
贴下pom配置吧,consumer端是需要依赖BeanPostProcessor的
这个还是只是单纯的起provider,还没到consumer端,provider应用启动是正常的,但是zk上没有发现服务注册成功。
同样启动后在zk上没有服务注册,且控制台启动没有报错
而且debug查看源码 发现
@PostConstruct public void init() throws Exception { Map<String, Object> beans = this.applicationContext.getBeansWithAnnotation(Service.class); for (Map.Entry<String, Object> entry : beans.entrySet()) { this.initProviderBean(entry.getKey(), entry.getValue()); } }
这里beans为空 没有任何Service注解的服务在容器中;
不知道是为何缘故?
同样的问题,配合spring标示bean的注解一并使用就能够在zk注册服务
同样的问题,zk没有注册到服务
我也遇到同样的问题,解决方法是Spring的@Service 和Dubbo的@Service都要写,如下:
@com.alibaba.dubbo.config.annotation.Service @Service public class UserManageServiceImpl implements UserManageService {
在Application上 加上 @EnableDubbo 就可以了
在Application上 加上 @EnableDubbo 就可以了
thank you very much ~ that is ok ~
控制台为何打印dubbo的bean不符合代理,下面是日志
Bean 'spring.dubbo-com.alibaba.dubbo.spring.boot.DubboProperties' of type [com.alibaba.dubbo.spring.boot.DubboProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-01-25 11:01:00.159 INFO 33212 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.dubbo.spring.boot.DubboAutoConfiguration' of type [com.alibaba.dubbo.spring.boot.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$d10d248] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-01-25 11:01:00.171 INFO 33212 --- [ main] c.a.dubbo.common.logger.LoggerFactory : using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter 2018-01-25 11:01:00.182 INFO 33212 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboApplicationConfig' of type [com.alibaba.dubbo.config.ApplicationConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-01-25 11:01:00.203 INFO 33212 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboRegistryConfig' of type [com.alibaba.dubbo.config.RegistryConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)