<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/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/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.4-SNAPSHOT</li>
<li>Operating System version: Mac</li>
<li>Java version: java11</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>config in xml like (other config keep the same as the previous version)</li>
</ol>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;dubbo:registry address=&quot;zookeeper://127.0.0.2:2181&quot;/&gt;

&lt;dubbo:config-center address=&quot;zookeeper://127.0.0.1:2181&quot;/&gt;"><pre class="notranslate">&lt;<span class="pl-ent">dubbo</span><span class="pl-ent">:</span><span class="pl-ent">registry</span> <span class="pl-e">address</span>=<span class="pl-s"><span class="pl-pds">"</span>zookeeper://127.0.0.2:2181<span class="pl-pds">"</span></span>/&gt;

&lt;<span class="pl-ent">dubbo</span><span class="pl-ent">:</span><span class="pl-ent">config-center</span> <span class="pl-e">address</span>=<span class="pl-s"><span class="pl-pds">"</span>zookeeper://127.0.0.1:2181<span class="pl-pds">"</span></span>/&gt;</pre></div>
<ol start="2" dir="auto">
<li>start the provider application</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">The application can log exception and exit</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">it will hang the main thread in the method of ZookeeperRegistry.java</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    @Override
    public void doRegister(URL url) {
        try {
            zkClient.create(toUrlPath(url), url.getParameter(DYNAMIC_KEY, true));
        } catch (Throwable e) {
            throw new RpcException(&quot;Failed to register &quot; + url + &quot; to zookeeper &quot; + getUrl() + &quot;, cause: &quot; + e.getMessage(), e);
        }
    }"><pre class="notranslate">    <span class="pl-c1">@</span><span class="pl-c1">Override</span>
    <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-s1">doRegister</span>(<span class="pl-smi">URL</span> <span class="pl-s1">url</span>) {
        <span class="pl-k">try</span> {
            <span class="pl-s1">zkClient</span>.<span class="pl-en">create</span>(<span class="pl-en">toUrlPath</span>(<span class="pl-s1">url</span>), <span class="pl-s1">url</span>.<span class="pl-en">getParameter</span>(<span class="pl-c1">DYNAMIC_KEY</span>, <span class="pl-c1">true</span>));
        } <span class="pl-k">catch</span> (<span class="pl-smi">Throwable</span> <span class="pl-s1">e</span>) {
            <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-smi">RpcException</span>(<span class="pl-s">"Failed to register "</span> + <span class="pl-s1">url</span> + <span class="pl-s">" to zookeeper "</span> + <span class="pl-en">getUrl</span>() + <span class="pl-s">", cause: "</span> + <span class="pl-s1">e</span>.<span class="pl-en">getMessage</span>(), <span class="pl-s1">e</span>);
        }
    }</pre></div>
<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.2</li>
<li>Operating System version: max</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>泛化调用，consumer端把如下json转为map泛化调用provider。<br>
{"flg":0,"name":"name1","age":1}</li>
<li>provider端接口参数类型如下：</li>
</ol>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class User {
    private String name;
    private int age;
    private boolean flg;
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">User</span> {
    <span class="pl-k">private</span> <span class="pl-smi">String</span> <span class="pl-s1">name</span>;
    <span class="pl-k">private</span> <span class="pl-smi">int</span> <span class="pl-s1">age</span>;
    <span class="pl-k">private</span> <span class="pl-smi">boolean</span> <span class="pl-s1">flg</span>;
}</pre></div>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Provider端能正常反序列化解析出User对象。</p>
<h5 dir="auto">PojoUtils的反序列化应该支持把数字类型转化为Boolean，fastjson、jackson等反序列都支持此特性。这样做可以更好支持跨语言调用，比如c没有bool型，只能用int表示bool。</h5>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">实际Provider端无法序列化抛出异常</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" com.alibaba.dubbo.remoting.RemotingException: java.lang.RuntimeException: Failed to set pojo NameAuthApi property isDefault value 0(class java.lang.Integer), cause: java.lang.ClassCastException@3a4a8341 java.lang.RuntimeException: Failed to set pojo NameAuthApi property isDefault value 0(class java.lang.Integer), cause: java.lang.ClassCastException@3a4a8341 
    at  com.alibaba.dubbo.common.utils.PojoUtils.realize0(PojoUtils.java:452) 
    at  com.alibaba.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:204) 
    at  com.alibaba.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:90) 
    at  com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:69) 
    at  com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 
    at  com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) 
    at  com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 
    at  com.alibaba.dubbo.rpc.filter.EchoFilter.invoke$sentryProxy(EchoFilter.java:38) "><pre class="notranslate"><code class="notranslate"> com.alibaba.dubbo.remoting.RemotingException: java.lang.RuntimeException: Failed to set pojo NameAuthApi property isDefault value 0(class java.lang.Integer), cause: java.lang.ClassCastException@3a4a8341 java.lang.RuntimeException: Failed to set pojo NameAuthApi property isDefault value 0(class java.lang.Integer), cause: java.lang.ClassCastException@3a4a8341 
    at  com.alibaba.dubbo.common.utils.PojoUtils.realize0(PojoUtils.java:452) 
    at  com.alibaba.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:204) 
    at  com.alibaba.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:90) 
    at  com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:69) 
    at  com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 
    at  com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) 
    at  com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 
    at  com.alibaba.dubbo.rpc.filter.EchoFilter.invoke$sentryProxy(EchoFilter.java:38) 
</code></pre></div>