<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. (This page is missing)</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.1-SNAPSHOT</li>
<li>Operating System version: MacOSX 10.14.1</li>
<li>Java version: 1.8.0_191</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Define exception class and other rpc classes<br>
定义异常类和其他 RPC 相关类</li>
</ol>
<h4 dir="auto">API Defination</h4>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class ValidationException extends RuntimeException {
    public ValidationException(String message) {
        super(message);
    }
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">ValidationException</span> <span class="pl-k">extends</span> <span class="pl-smi">RuntimeException</span> {
    <span class="pl-k">public</span> <span class="pl-smi">ValidationException</span>(<span class="pl-smi">String</span> <span class="pl-s1">message</span>) {
        <span class="pl-en">super</span>(<span class="pl-s1">message</span>);
    }
}</pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface MailService {
    MailResponse send(MailRequest request);
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">MailService</span> {
    <span class="pl-smi">MailResponse</span> <span class="pl-en">send</span>(<span class="pl-smi">MailRequest</span> <span class="pl-s1">request</span>);
}</pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Data
public class MailRequest implements Serializable {
    /**
     * 收件人邮箱地址
     */
    @NotBlank(message = &quot;收件人不能为空&quot;)
    @Email(message = &quot;收件人只能是一个 Email 地址&quot;)
    private String to;
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Data</span>
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MailRequest</span> <span class="pl-k">implements</span> <span class="pl-smi">Serializable</span> {
    <span class="pl-c">/**</span>
<span class="pl-c">     * 收件人邮箱地址</span>
<span class="pl-c">     */</span>
    <span class="pl-c1">@</span><span class="pl-c1">NotBlank</span>(<span class="pl-s1">message</span> = <span class="pl-s">"收件人不能为空"</span>)
    <span class="pl-c1">@</span><span class="pl-c1">Email</span>(<span class="pl-s1">message</span> = <span class="pl-s">"收件人只能是一个 Email 地址"</span>)
    <span class="pl-k">private</span> <span class="pl-smi">String</span> <span class="pl-s1">to</span>;
}</pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Data
public class MailResponse implements Serializable {
    /** 是否成功*/
    private boolean success = true;
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Data</span>
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MailResponse</span> <span class="pl-k">implements</span> <span class="pl-smi">Serializable</span> {
    <span class="pl-c">/** 是否成功*/</span>
    <span class="pl-k">private</span> <span class="pl-smi">boolean</span> <span class="pl-s1">success</span> = <span class="pl-c1">true</span>;
}</pre></div>
<h4 dir="auto">Provider</h4>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Service(version = &quot;${service.version}&quot;,protocol = &quot;${dubbo.protocol.id}&quot;,application = &quot;${dubbo.application.name}&quot;,registry = &quot;${dubbo.registry.id}&quot;,executes = 32)
public class MailServiceImpl implements MailService {
    // ...

    @Override
    public ServerResponse send(MailRequest request) {
        Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
        Set&lt;ConstraintViolation&lt;MailRequest&gt;&gt; vset = validator.validate(request);
        if (!vset.isEmpty()) {
            throw new ValidationException(vset.iterator().next().getMessage());
        }
        return new MailResponse();
    }
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Service</span>(<span class="pl-s1">version</span> = <span class="pl-s">"${service.version}"</span>,<span class="pl-s1">protocol</span> = <span class="pl-s">"${dubbo.protocol.id}"</span>,<span class="pl-s1">application</span> = <span class="pl-s">"${dubbo.application.name}"</span>,<span class="pl-s1">registry</span> = <span class="pl-s">"${dubbo.registry.id}"</span>,<span class="pl-s1">executes</span> = <span class="pl-c1">32</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MailServiceImpl</span> <span class="pl-k">implements</span> <span class="pl-smi">MailService</span> {
    <span class="pl-c">// ...</span>

    <span class="pl-c1">@</span><span class="pl-c1">Override</span>
    <span class="pl-k">public</span> <span class="pl-smi">ServerResponse</span> <span class="pl-en">send</span>(<span class="pl-smi">MailRequest</span> <span class="pl-s1">request</span>) {
        <span class="pl-smi">Validator</span> <span class="pl-s1">validator</span> = <span class="pl-smi">Validation</span>.<span class="pl-en">buildDefaultValidatorFactory</span>().<span class="pl-en">getValidator</span>();
        <span class="pl-smi">Set</span>&lt;<span class="pl-smi">ConstraintViolation</span>&lt;<span class="pl-smi">MailRequest</span>&gt;&gt; <span class="pl-s1">vset</span> = <span class="pl-s1">validator</span>.<span class="pl-en">validate</span>(<span class="pl-s1">request</span>);
        <span class="pl-k">if</span> (!<span class="pl-s1">vset</span>.<span class="pl-en">isEmpty</span>()) {
            <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-smi">ValidationException</span>(<span class="pl-s1">vset</span>.<span class="pl-en">iterator</span>().<span class="pl-en">next</span>().<span class="pl-en">getMessage</span>());
        }
        <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">MailResponse</span>();
    }
}</pre></div>
<h4 dir="auto">Consumer</h4>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="            try {
                MailResponse response = mailService.send(request);
                System.out.println(response.isSuccess());
            } catch (Exception e) {
                e.printStackTrace();
            }"><pre class="notranslate">            <span class="pl-k">try</span> {
                <span class="pl-smi">MailResponse</span> <span class="pl-s1">response</span> = <span class="pl-s1">mailService</span>.<span class="pl-en">send</span>(<span class="pl-s1">request</span>);
                <span class="pl-smi">System</span>.<span class="pl-s1">out</span>.<span class="pl-en">println</span>(<span class="pl-s1">response</span>.<span class="pl-en">isSuccess</span>());
            } <span class="pl-k">catch</span> (<span class="pl-smi">Exception</span> <span class="pl-s1">e</span>) {
                <span class="pl-s1">e</span>.<span class="pl-en">printStackTrace</span>();
            }</pre></div>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">此处应当可捕获 <code class="notranslate">ValidationException</code></p>
<p dir="auto">Expect <code class="notranslate">ValidationException</code> to be caught.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">但是我们捕获到了 <code class="notranslate">UndeclaredThrowableException</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy36.send(Unknown Source)
	at test.....MailRunner.lambda$runner$0(MailRunner.java:38)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804)
	at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:794)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at test.....MailRunner.main(MailRunner.java:54)
Caused by: java.lang.reflect.InvocationTargetException
	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 com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:159)
	... 8 more
Caused by: ....ValidationException: may not be empty
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.googlecode.jsonrpc4j.DefaultExceptionResolver.createThrowable(DefaultExceptionResolver.java:162)
	at com.googlecode.jsonrpc4j.DefaultExceptionResolver.resolveException(DefaultExceptionResolver.java:82)
	at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:345)
	at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:285)
	at com.googlecode.jsonrpc4j.JsonRpcHttpClient.invoke(JsonRpcHttpClient.java:161)
	at com.googlecode.jsonrpc4j.spring.JsonProxyFactoryBean.invoke(JsonProxyFactoryBean.java:136)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
	at com.sun.proxy.$Proxy35.send(Unknown Source)
	at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)
	at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
	at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76)
	at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:97)
	at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:155)
	at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77)
	at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:49)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:78)
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:244)
	at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)
	at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
	at com.alibaba.dubbo.common.bytecode.proxy0.send(proxy0.java)
	... 13 more"><pre class="notranslate"><code class="notranslate">java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy36.send(Unknown Source)
	at test.....MailRunner.lambda$runner$0(MailRunner.java:38)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804)
	at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:794)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at test.....MailRunner.main(MailRunner.java:54)
Caused by: java.lang.reflect.InvocationTargetException
	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 com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:159)
	... 8 more
Caused by: ....ValidationException: may not be empty
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.googlecode.jsonrpc4j.DefaultExceptionResolver.createThrowable(DefaultExceptionResolver.java:162)
	at com.googlecode.jsonrpc4j.DefaultExceptionResolver.resolveException(DefaultExceptionResolver.java:82)
	at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:345)
	at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:285)
	at com.googlecode.jsonrpc4j.JsonRpcHttpClient.invoke(JsonRpcHttpClient.java:161)
	at com.googlecode.jsonrpc4j.spring.JsonProxyFactoryBean.invoke(JsonProxyFactoryBean.java:136)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
	at com.sun.proxy.$Proxy35.send(Unknown Source)
	at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)
	at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
	at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76)
	at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:97)
	at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:155)
	at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77)
	at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:49)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:78)
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:244)
	at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)
	at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
	at com.alibaba.dubbo.common.bytecode.proxy0.send(proxy0.java)
	... 13 more
</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: v2.7.3</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Actual Result</h3>
<p dir="auto"><a href="https://github.com/apache/dubbo/blob/master/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java#L77">https://github.com/apache/dubbo/blob/master/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java#L77</a></p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="logger.warn(&quot;You specified the config centre, but there's not even one single config item in it.&quot;);"><pre class="notranslate"><span class="pl-s1">logger</span>.<span class="pl-en">warn</span>(<span class="pl-s">"You specified the config centre, but there's not even one single config item in it."</span>);</pre></div>
<h3 dir="auto">Expected Result</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="logger.warn(&quot;You specified the config center, but there's not even one single config item in it.&quot;);"><pre class="notranslate"><span class="pl-s1">logger</span>.<span class="pl-en">warn</span>(<span class="pl-s">"You specified the config center, but there's not even one single config item in it."</span>);</pre></div>
<p dir="auto">Although <code class="notranslate">centre</code> has a simmilar meaning with <code class="notranslate">center</code>, we usually call a config center <code class="notranslate">config center</code> but not <code class="notranslate">config centre</code>. so consider changing it to <code class="notranslate">config center</code>?</p>