<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.7</li>
<li>Operating System version: macOS Mojave</li>
<li>Java version: 1.8</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" @Override
    public BeanDefinition parse(Element element, ParserContext parserContext) {
        ...
        registerApplicationListeners(registry);
        ..."><pre class="notranslate"><code class="notranslate"> @Override
    public BeanDefinition parse(Element element, ParserContext parserContext) {
        ...
        registerApplicationListeners(registry);
        ...
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="private void registerApplicationListeners(BeanDefinitionRegistry registry) {
        registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
        registerBeans(registry, DubboBootstrapApplicationListener.class);
}"><pre class="notranslate"><code class="notranslate">private void registerApplicationListeners(BeanDefinitionRegistry registry) {
        registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
        registerBeans(registry, DubboBootstrapApplicationListener.class);
}
</code></pre></div>
<p dir="auto">解析每一个element节点都会调用registerApplicationListeners方法,虽然在registerBeans中是有判断<br>
bean是否已经注册过了,如果注册就忽略,但是可以在registerApplicationListeners方法中判断下,如果已经存在了就不再调用registerBeans方法了</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="private void registerApplicationListeners(BeanDefinitionRegistry registry) {
         if (!isPresentBean(registry, DubboLifecycleComponentApplicationListener.class)) {
                registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
         }
        if (!isPresentBean(registry, DubboBootstrapApplicationListener.class)) {
                registerBeans(registry, DubboBootstrapApplicationListener.class);
         }
}"><pre class="notranslate"><code class="notranslate">private void registerApplicationListeners(BeanDefinitionRegistry registry) {
         if (!isPresentBean(registry, DubboLifecycleComponentApplicationListener.class)) {
                registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
         }
        if (!isPresentBean(registry, DubboBootstrapApplicationListener.class)) {
                registerBeans(registry, DubboBootstrapApplicationListener.class);
         }
}
</code></pre></div>
<p dir="auto">Just put your stack trace here!</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></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.6.x</li>
<li>Operating System version: MacOS 10.12.6</li>
<li>Java version: 1.8.0_181</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Consumer set retries and invoke any provider via generic invocation.</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Get the correct retries in FailoverClusterInvoker.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public Result doInvoke(Invocation invocation, final List&lt;Invoker&lt;T&gt;&gt; invokers, LoadBalance loadbalance) throws RpcException { 
        List&lt;Invoker&lt;T&gt;&gt; copyinvokers = invokers;
        checkInvokers(copyinvokers, invocation);
        String methodName = RpcUtils.getMethodName(invocation);
        int len = getUrl().getMethodParameter(methodName, Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
        if (len &lt;= 0) {
            len = 1;
        }
        ..."><pre class="notranslate"><code class="notranslate">public Result doInvoke(Invocation invocation, final List&lt;Invoker&lt;T&gt;&gt; invokers, LoadBalance loadbalance) throws RpcException { 
        List&lt;Invoker&lt;T&gt;&gt; copyinvokers = invokers;
        checkInvokers(copyinvokers, invocation);
        String methodName = RpcUtils.getMethodName(invocation);
        int len = getUrl().getMethodParameter(methodName, Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
        if (len &lt;= 0) {
            len = 1;
        }
        ...
</code></pre></div>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Get the default retires cause use incorrect method name.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public Result doInvoke(Invocation invocation, final List&lt;Invoker&lt;T&gt;&gt; invokers, LoadBalance loadbalance) throws RpcException {
        List&lt;Invoker&lt;T&gt;&gt; copyinvokers = invokers;
        checkInvokers(copyinvokers, invocation);
        int len = getUrl().getMethodParameter(invocation.getMethodName(), Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
        if (len &lt;= 0) {
            len = 1;
        }
        ..."><pre class="notranslate"><code class="notranslate">public Result doInvoke(Invocation invocation, final List&lt;Invoker&lt;T&gt;&gt; invokers, LoadBalance loadbalance) throws RpcException {
        List&lt;Invoker&lt;T&gt;&gt; copyinvokers = invokers;
        checkInvokers(copyinvokers, invocation);
        int len = getUrl().getMethodParameter(invocation.getMethodName(), Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
        if (len &lt;= 0) {
            len = 1;
        }
        ...
</code></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>