<ul dir="auto">
<li>[<g-emoji class="g-emoji" alias="heavy_check_mark" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png">✔</g-emoji> ] I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li>[ <g-emoji class="g-emoji" alias="heavy_check_mark" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png">✔</g-emoji>] I have checked the <a href="https://github.com/apache/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.6.3</li>
<li>Operating System version: win10</li>
<li>Java version: 12.0.2</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>我在阅读ReferenceBean这一部分代码的时候，我注意到这个类实现了FactoryBean，ApplicationContextAware，InitializingBean，DisposableBean方法，这些都是Sping IOC对Bean功能增强提供的接口，期初我以为ReferenceBean也属于Spring IOC管理，然而我在Beanfactory中并没有找到任何ReferenceBean的痕迹。</li>
<li>后来我发现这些功能增强的接口并不是有IOC调用了，而是由dubbo代码对其调用。</li>
<li>我觉得这个地方迷惑性很大，请问这里刻意这么设计的原因是希望读者像理解Spring Bean一样理解ReferenceBean吗？还是有其他原因？希望管理员能从想法，设计方面给予回答，谢谢。</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？<br>
设计时的想法与初衷</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<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/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/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.3-SNAPSHOT</li>
<li>Operating System version: mac catline</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">使用 apollo 当配置中心，dubbo配置放在默认的dubbo.properties namespace<br>
bootstrap.yml中的配置</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="spring:
  application:
    name: mls-biz-company
apollo:
  bootstrap:
    enabled: true
    namespaces: application,dubbo"><pre class="notranslate"><code class="notranslate">spring:
  application:
    name: mls-biz-company
apollo:
  bootstrap:
    enabled: true
    namespaces: application,dubbo
</code></pre></div>
<p dir="auto">apollo dubbo.properties 中的配置</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dubbo.registry-cache = ${java.io.tmpdir:-/tmp}
dubbo.application.name = ${spring.application.name}
dubbo.protocol.name = dubbo
dubbo.protocol.port = ${server.dubbo-port}
dubbo.scan.base-packages = com.lianjia.mls.company
dubbo.config-center.address = apollo://dev.config.apollo.ke.com

dubbo.metadata-report.group = /home/likemoon/dubbo
dubbo.metadata-report.username = myname
dubbo.metadata-report.address = zookeeper://zk01-test.likemoon.com:2181
dubbo.metadata-report.password = mypasswd

dubbo.registries.alliance.address = ..."><pre class="notranslate"><code class="notranslate">dubbo.registry-cache = ${java.io.tmpdir:-/tmp}
dubbo.application.name = ${spring.application.name}
dubbo.protocol.name = dubbo
dubbo.protocol.port = ${server.dubbo-port}
dubbo.scan.base-packages = com.lianjia.mls.company
dubbo.config-center.address = apollo://dev.config.apollo.ke.com

dubbo.metadata-report.group = /home/likemoon/dubbo
dubbo.metadata-report.username = myname
dubbo.metadata-report.address = zookeeper://zk01-test.likemoon.com:2181
dubbo.metadata-report.password = mypasswd

dubbo.registries.alliance.address = ...
</code></pre></div>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？<br>
启动的时候能正确解析dubbo.application.name 的 placeholder : ${spring.application.name}</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?<br>
服务启动过程报错</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[DUBBO] Failed to override , dubbo version: 2.7.3-SNAPSHOT, current host: 10.33.69.254

java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.dubbo.config.AbstractConfig.refresh(AbstractConfig.java:569)
	at org.apache.dubbo.config.ApplicationConfig.refresh(ApplicationConfig.java:387)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.apache.dubbo.config.context.ConfigManager.refreshAll(ConfigManager.java:302)
	at org.apache.dubbo.config.AbstractInterfaceConfig.startConfigCenter(AbstractInterfaceConfig.java:281)
	at org.apache.dubbo.config.ServiceConfig.checkAndUpdateSubConfigs(ServiceConfig.java:285)
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:358)
	at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:327)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:105)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:51)
	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:402)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
	at com.lianjia.mls.company.Application.main(Application.java:20)
Caused by: java.lang.IllegalStateException: Invalid name=&quot;${spring.application.name}&quot; contains illegal character, only digit, letter, '-', '_' or '.' is legal.
	at org.apache.dubbo.config.AbstractConfig.checkProperty(AbstractConfig.java:387)
	at org.apache.dubbo.config.AbstractConfig.checkName(AbstractConfig.java:345)
	at org.apache.dubbo.config.ApplicationConfig.setName(ApplicationConfig.java:163)
	... 29 common frames omitted"><pre class="notranslate"><code class="notranslate">[DUBBO] Failed to override , dubbo version: 2.7.3-SNAPSHOT, current host: 10.33.69.254

java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.dubbo.config.AbstractConfig.refresh(AbstractConfig.java:569)
	at org.apache.dubbo.config.ApplicationConfig.refresh(ApplicationConfig.java:387)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.apache.dubbo.config.context.ConfigManager.refreshAll(ConfigManager.java:302)
	at org.apache.dubbo.config.AbstractInterfaceConfig.startConfigCenter(AbstractInterfaceConfig.java:281)
	at org.apache.dubbo.config.ServiceConfig.checkAndUpdateSubConfigs(ServiceConfig.java:285)
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:358)
	at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:327)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:105)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:51)
	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:402)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
	at com.lianjia.mls.company.Application.main(Application.java:20)
Caused by: java.lang.IllegalStateException: Invalid name="${spring.application.name}" contains illegal character, only digit, letter, '-', '_' or '.' is legal.
	at org.apache.dubbo.config.AbstractConfig.checkProperty(AbstractConfig.java:387)
	at org.apache.dubbo.config.AbstractConfig.checkName(AbstractConfig.java:345)
	at org.apache.dubbo.config.ApplicationConfig.setName(ApplicationConfig.java:163)
	... 29 common frames omitted
</code></pre></div>
<p dir="auto">看代码从配置中心取到之后未处理 placeholder<br>
在refresh 过程总反射调用org.apache.dubbo.config.ApplicationConfig.setName(java.lang.String)过程中报如上的异常</p>