java - dubbo两个提供者互相调用的问题
阿神
阿神 2017-04-18 10:44:12
0
7
2019
阿神
阿神

闭关修行中......

reply all(7)
洪涛

@Autowired has a required attribute, which can be configured as false. In this case, if the corresponding bean is not found, an exception will not be thrown.

PHPzhong

Post the error message and take a look. There are many reasons why the injection cannot be done. Depends on the error message for details

黄舟
<dubbo:reference interface="com.BService" id="bService"></dubbo:reference>
<dubbo:service interface="com.AService" ref="aService"></dubbo:service>

Should the human ref in AService point to bService?

阿神

Is it possible that the @Service annotation introduces an error? What should be used here is Spring's @Service (org.springframework.stereotype.Servic). If dubbo's @Service is used, it cannot be injected.

PHPzhong

The reason for the error is that the target provided class cannot be found. By default, dubbo will check whether the provided class exists. If it does not exist, an error will be reported directly

Option 1: Do not check the configuration reference<dubbo:reference check="false" interface="com.BService" id="bService"></dubbo:reference>, so that no error will be reported when starting, and it will not affect use.

Option 2:
1. First comment out dubbo:reference of S1 or S2 (assuming it is S1);
2. Start S1, then the AService service will be provided, and S2 can start normally;
3. Cancel Notes for S1, restart.

阿神

Configure consumer check on the consumer side. When starting, it does not check whether the producer is started.

<dubbo:consumer check="false" />
小葫芦

You can refer to this video content: http://www.roncoo.com/course/...

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!