java - dubbo配置问题 Duplicate spring bean id 求帮助
高洛峰
高洛峰 2017-04-18 10:24:44
0
3
1748

这部分是provider的配置:


在通过main方法启动后已经成功将服务注册到zk上,

这部分是consumer的单元测试配置:

包扫描:

测试方法:

最后报错如下:

求助,谢谢

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all (3)
巴扎黑

Check if there are any annotations on your SpeakInterface class, or the annotations of other classes also have the same name
The log shows that it is repeatedly defined

    PHPzhong

    Your speakInterface bean id has the same name globally. The easiest way is to change the current bean ID to another one and that should be enough.
    It is recommended that you put the consumer test code into another project instead of the provider in the same project for an interview

      迷茫

      Since you are testing under the same project, don’t repeat the bean name

      Consumer

      Producer

      Look at the red box and think carefully whether the bean managed by spring has the same name? Just change the ID of one of them and try it again.

      In addition, I remember that dubbo looks for services on zk based on package name-class name. You can use zkClient to check this. It is similar to cxf's webservice. It has nothing to do with bean id, but has something to do with class (interface)

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!