alibaba / dubbo-spring-boot-starter

Dubbo Spring Boot Starter
Apache License 2.0
2.1k stars 745 forks source link

按照demo配置,没有成功注册服务 #48

Closed liangyd1024 closed 6 years ago

liangyd1024 commented 6 years ago

控制台为何打印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)

mark-wk commented 6 years ago

遇到同样的问题,,请问解决了吗

xionghuiCoder commented 6 years ago

贴下pom配置吧,consumer端是需要依赖BeanPostProcessor的

liangyd1024 commented 6 years ago

这个还是只是单纯的起provider,还没到consumer端,provider应用启动是正常的,但是zk上没有发现服务注册成功。

xucong0213 commented 6 years ago

同样启动后在zk上没有服务注册,且控制台启动没有报错

liangyd1024 commented 6 years ago

而且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注解的服务在容器中; 不知道是为何缘故?

mockorz commented 6 years ago

同样的问题,配合spring标示bean的注解一并使用就能够在zk注册服务

XujunZhang commented 6 years ago

同样的问题,zk没有注册到服务

windyzj commented 6 years ago

我也遇到同样的问题,解决方法是Spring的@Service 和Dubbo的@Service都要写,如下:

@com.alibaba.dubbo.config.annotation.Service @Service public class UserManageServiceImpl implements UserManageService {

xionghuiCoder commented 6 years ago

61

huixw commented 6 years ago

在Application上 加上 @EnableDubbo 就可以了

ghost commented 6 years ago

在Application上 加上 @EnableDubbo 就可以了

thank you very much ~ that is ok ~