[apache/dubbo]发现一个注册服务的BUG

2024-04-11 885 views
2

bug 如上图所示,上图的代码,是无法注册成为dubbo的服务的,搞了好久。最后发现,是命名出了问题,我把它改为如下的命名就好了 real

我不知道你们的有没有问题,我是从git上面clone的代码install的。命令中带有Java的,都无法扫描成为服务

回答

5

这是个蹊跷的问题,你用的是dubbo什么版本?

8

这应该是用法有问题,只需要一个@Service(version = "1.0.0")注解就够了 import com.alibaba.dubbo.config.annotation.Service; import com.icitic.fusion.cashier.qrcode.api.IQrCodeService; import org.springframework.beans.factory.annotation.Autowired;

/**

  • 二维码服务实现
  • Created by lys on 2017/8/8. */ @Service(version = "1.0.0") public class QrCodeServiceImpl implements IQrCodeService {
0

就是当前版本,刚从github上面glone下来的

4

@chickenlj dubbo 2.5.7版本 我在使用过程中也发现,当一个类同时使用dubbo的@service,和spring的@compent、@service等时,无法注册dubbo服务

5

@foreveryang321 我可以用呢2.5.7。

8

@crazyhuntsman 这个问题会在 2.5.8 版本里面修复掉

1

@foreveryang321 @zxj19951029 2.5.7版本目前不支持同时使用Spring Service注解和dubbo service注解,你的这种场景,再定义一个外层Facade的包装类型,在只上做dubbo service注解是否更合理一些

因为我理解你DefaultMailSender还要做spring service注解是在provider内部有使用,用facade可以做到内部外部服务分离

4

@zxj19951029 你这个问题我本地没有发现,能不能上传一段 demo code

1

This seems to be a problem, we should fix it in 2.5.8. When i add ComponentScan to your test, this happens default

6

ServiceAnnotationBeanPostProcessor should always execute behind Transactional PostProcessor, should we give ServiceAnnotationBeanPostProcessor the lowest order explicitly?

2
1029