Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.0

Operating System version: windows or linux

Java version: 1.8

spring-cloud-starter-openfeign:2.0.2.RELEASE

Steps to reproduce this issue

项目 引入openFeign,dubbo

Bean里面依赖 openFeign的客户端接口和Dubbo 消费者

例如:

@FeignClient(name = "F6HttpInterFace",configuration = HttpConfig.class, url = "${f6.api}/open-api")
public interface F6HttpInterface

@Autowired
F6HttpInterface f6HttpInterface
@Reference
private VehicleTypeFacade vehicleTypeFacade;

启动 工程

看了下代码,应该是

openFeign 会创建 AnnotationConfigApplicationContext 并且调用refresh();

所以会发送一个openFeign spring上下文的ContextRefreshedEvent事件

然后dubbo接收,就报错了

org.apache.dubbo.config.spring.ServiceBean#onApplicationEvent

Expected Result

Spring正常启动

Actual Result

Caused by: java.lang.IllegalStateException: <dubbo:service interface="" /> interface not allow null!
at org.apache.dubbo.config.ServiceConfig.checkAndUpdateSubConfigs(ServiceConfig.java:276)
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:328)
at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:318)
at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:112)
at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:58)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:406)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:354)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:886)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.cloud.context.named.NamedContextFactory.createContext(NamedContextFactory.java:117)
at org.springframework.cloud.context.named.NamedContextFactory.getContext(NamedContextFactory.java:85)
at org.springframework.cloud.context.named.NamedContextFactory.getInstance(NamedContextFactory.java:126)
at org.springframework.cloud.openfeign.FeignClientFactoryBean.get(FeignClientFactoryBean.java:205)
at org.springframework.cloud.openfeign.FeignClientFactoryBean.feign(FeignClientFactoryBean.java:84)
at org.springframework.cloud.openfeign.FeignClientFactoryBean.getTarget(FeignClientFactoryBean.java:241)
at org.springframework.cloud.openfeign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:232)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:171)
... 121 common frames omitted

Just put your stack trace here!

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Target

Add a generation rule of @Service Bean name in order to avoid duplication and is easy to look-up injected-dependencies.

Environment

Dubbo version: 2.6.4

Operating System version: all

Java version: 1.6-1.8