<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.0</li>
<li>Operating System version: windows or linux</li>
<li>Java version: 1.8<br>
spring-cloud-starter-openfeign:2.0.2.RELEASE</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>项目 引入openFeign,dubbo</li>
<li>Bean里面依赖 openFeign的客户端接口和Dubbo 消费者</li>
</ol>
<p dir="auto">例如:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@FeignClient(name = &quot;F6HttpInterFace&quot;,configuration = HttpConfig.class, url = &quot;${f6.api}/open-api&quot;)
public interface F6HttpInterface"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">FeignClient</span>(<span class="pl-s1">name</span> = <span class="pl-s">"F6HttpInterFace"</span>,<span class="pl-s1">configuration</span> = <span class="pl-smi">HttpConfig</span>.<span class="pl-k">class</span>, <span class="pl-s1">url</span> = <span class="pl-s">"${f6.api}/open-api"</span>)
<span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-s1">F6HttpInterface</span></pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Autowired
F6HttpInterface f6HttpInterface 
@Reference
private VehicleTypeFacade vehicleTypeFacade;"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Autowired</span>
<span class="pl-smi">F6HttpInterface</span> <span class="pl-s1">f6HttpInterface</span> 
<span class="pl-c1">@</span><span class="pl-c1">Reference</span>
<span class="pl-k">private</span> <span class="pl-s1">VehicleTypeFacade</span> <span class="pl-s1">vehicleTypeFacade</span>;</pre></div>
<ol start="3" dir="auto">
<li>启动 工程</li>
</ol>
<p dir="auto">看了下代码,应该是<br>
openFeign 会创建  AnnotationConfigApplicationContext 并且调用refresh();<br>
所以会发送一个openFeign spring上下文的ContextRefreshedEvent事件<br>
然后dubbo接收,就报错了<br>
org.apache.dubbo.config.spring.ServiceBean#onApplicationEvent</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Spring正常启动</p>
<h3 dir="auto">Actual Result</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Caused by: java.lang.IllegalStateException: &lt;dubbo:service interface=&quot;&quot; /&gt; 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"><pre class="notranslate"><span class="pl-smi">Caused</span> <span class="pl-s1">by</span>: <span class="pl-s1">java</span>.<span class="pl-s1">lang</span>.<span class="pl-s1">IllegalStateException</span>: &lt;<span class="pl-s1">dubbo</span>:<span class="pl-s1">service</span> <span class="pl-s1">interface</span>=<span class="pl-s">""</span> /<span class="pl-s1"></span>&gt; <span class="pl-smi">interface</span> <span class="pl-s1">not</span> <span class="pl-s1">allow</span> <span class="pl-c1">null</span>!
	<span class="pl-smi">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">config</span>.<span class="pl-s1">ServiceConfig</span>.<span class="pl-en">checkAndUpdateSubConfigs</span>(<span class="pl-smi">ServiceConfig</span>.<span class="pl-smi">java</span>:<span class="pl-c1">276</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">config</span>.<span class="pl-s1">ServiceConfig</span>.<span class="pl-en">export</span>(<span class="pl-smi">ServiceConfig</span>.<span class="pl-smi">java</span>:<span class="pl-c1">328</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">config</span>.<span class="pl-s1">spring</span>.<span class="pl-s1">ServiceBean</span>.<span class="pl-en">export</span>(<span class="pl-smi">ServiceBean</span>.<span class="pl-smi">java</span>:<span class="pl-c1">318</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">config</span>.<span class="pl-s1">spring</span>.<span class="pl-s1">ServiceBean</span>.<span class="pl-en">onApplicationEvent</span>(<span class="pl-smi">ServiceBean</span>.<span class="pl-smi">java</span>:<span class="pl-c1">112</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">config</span>.<span class="pl-s1">spring</span>.<span class="pl-s1">ServiceBean</span>.<span class="pl-en">onApplicationEvent</span>(<span class="pl-smi">ServiceBean</span>.<span class="pl-smi">java</span>:<span class="pl-c1">58</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">event</span>.<span class="pl-s1">SimpleApplicationEventMulticaster</span>.<span class="pl-en">doInvokeListener</span>(<span class="pl-smi">SimpleApplicationEventMulticaster</span>.<span class="pl-smi">java</span>:<span class="pl-c1">172</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">event</span>.<span class="pl-s1">SimpleApplicationEventMulticaster</span>.<span class="pl-en">invokeListener</span>(<span class="pl-smi">SimpleApplicationEventMulticaster</span>.<span class="pl-smi">java</span>:<span class="pl-c1">165</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">event</span>.<span class="pl-s1">SimpleApplicationEventMulticaster</span>.<span class="pl-en">multicastEvent</span>(<span class="pl-smi">SimpleApplicationEventMulticaster</span>.<span class="pl-smi">java</span>:<span class="pl-c1">139</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">support</span>.<span class="pl-s1">AbstractApplicationContext</span>.<span class="pl-en">publishEvent</span>(<span class="pl-smi">AbstractApplicationContext</span>.<span class="pl-smi">java</span>:<span class="pl-c1">400</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">support</span>.<span class="pl-s1">AbstractApplicationContext</span>.<span class="pl-en">publishEvent</span>(<span class="pl-smi">AbstractApplicationContext</span>.<span class="pl-smi">java</span>:<span class="pl-c1">406</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">support</span>.<span class="pl-s1">AbstractApplicationContext</span>.<span class="pl-en">publishEvent</span>(<span class="pl-smi">AbstractApplicationContext</span>.<span class="pl-smi">java</span>:<span class="pl-c1">354</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">support</span>.<span class="pl-s1">AbstractApplicationContext</span>.<span class="pl-en">finishRefresh</span>(<span class="pl-smi">AbstractApplicationContext</span>.<span class="pl-smi">java</span>:<span class="pl-c1">886</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">context</span>.<span class="pl-s1">support</span>.<span class="pl-s1">AbstractApplicationContext</span>.<span class="pl-en">refresh</span>(<span class="pl-smi">AbstractApplicationContext</span>.<span class="pl-smi">java</span>:<span class="pl-c1">551</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">cloud</span>.<span class="pl-s1">context</span>.<span class="pl-s1">named</span>.<span class="pl-s1">NamedContextFactory</span>.<span class="pl-en">createContext</span>(<span class="pl-smi">NamedContextFactory</span>.<span class="pl-smi">java</span>:<span class="pl-c1">117</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">cloud</span>.<span class="pl-s1">context</span>.<span class="pl-s1">named</span>.<span class="pl-s1">NamedContextFactory</span>.<span class="pl-en">getContext</span>(<span class="pl-smi">NamedContextFactory</span>.<span class="pl-smi">java</span>:<span class="pl-c1">85</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">cloud</span>.<span class="pl-s1">context</span>.<span class="pl-s1">named</span>.<span class="pl-s1">NamedContextFactory</span>.<span class="pl-en">getInstance</span>(<span class="pl-smi">NamedContextFactory</span>.<span class="pl-smi">java</span>:<span class="pl-c1">126</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">cloud</span>.<span class="pl-s1">openfeign</span>.<span class="pl-s1">FeignClientFactoryBean</span>.<span class="pl-en">get</span>(<span class="pl-smi">FeignClientFactoryBean</span>.<span class="pl-smi">java</span>:<span class="pl-c1">205</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">cloud</span>.<span class="pl-s1">openfeign</span>.<span class="pl-s1">FeignClientFactoryBean</span>.<span class="pl-en">feign</span>(<span class="pl-smi">FeignClientFactoryBean</span>.<span class="pl-smi">java</span>:<span class="pl-c1">84</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">cloud</span>.<span class="pl-s1">openfeign</span>.<span class="pl-s1">FeignClientFactoryBean</span>.<span class="pl-en">getTarget</span>(<span class="pl-smi">FeignClientFactoryBean</span>.<span class="pl-smi">java</span>:<span class="pl-c1">241</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">cloud</span>.<span class="pl-s1">openfeign</span>.<span class="pl-s1">FeignClientFactoryBean</span>.<span class="pl-en">getObject</span>(<span class="pl-smi">FeignClientFactoryBean</span>.<span class="pl-smi">java</span>:<span class="pl-c1">232</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">beans</span>.<span class="pl-s1">factory</span>.<span class="pl-s1">support</span>.<span class="pl-s1">FactoryBeanRegistrySupport</span>.<span class="pl-en">doGetObjectFromFactoryBean</span>(<span class="pl-smi">FactoryBeanRegistrySupport</span>.<span class="pl-smi">java</span>:<span class="pl-c1">171</span>)
	... <span class="pl-c1">121</span> <span class="pl-s1">common</span> <span class="pl-smi">frames</span> <span class="pl-s1">omitted</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Target</h3>
<p dir="auto">Add a generation rule of <code class="notranslate">@Service</code> Bean name in order to avoid duplication and is easy to look-up injected-dependencies.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.4</li>
<li>Operating System version: all</li>
<li>Java version: 1.6-1.8</li>
</ul>