apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.32k stars 26.38k forks source link

Dubbo2.7.14 injvm调用问题 #9479

Open kody1025 opened 2 years ago

kody1025 commented 2 years ago

Ask your question here

Dubbo version: 2.7.14 在同一个项目里面暴露服务和引用:

@DubboService
public class CustomMatchDubboService implements CustomMatchApi {}

@RestController
public class CustomMatchController {
    @DubboReference(injvm=true, connections=1)
    private CustomMatchApi customMatchApi;

出现报错: Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.api.CustomMatchApi. No provider available for the service com.api.CustomMatchApi from the url injvm://127.0.0.1/com.api.CustomMatchApi?application=oxp-upms-server&connections=1&dubbo=2.0.2&dump.directory=/opt/dubbo&init=false&injvm=true&interface=com.api.CustomMatchApi&methods=oneCustomizeMatchResult,batchCustomizeMatchResult&pid=72340&qos.enable=false&register.ip=10.108.81.167&release=2.7.14&side=consumer&sticky=false&timestamp=1640248512267 to the consumer 10.108.81.167 use dubbo version 2.7.14

debug发现: 图片 在ReferenceAnnotationBeanPostProcessor里拿到的注解属性只有connections,而没有injvm,导致后面的isLocalServiceBean返回false而没有做到injvm相关的操作。请问应该如何解决?

codeimport commented 2 years ago

可以在reference端设置check=false试试,应该能解决问题。