<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">Environment</h3>
<ul dir="auto">
<li>Dubbo version: latest master branch</li>
<li>Operating System version: macos</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Description</h3>
<p dir="auto">in ChannelEventRunnable#run there is a switch-case fall through which is introduced in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/dubbo/commit/b3e91fae80fa6016f0c48884ca0db0f942f2af77/hovercard" href="https://github.com/apache/dubbo/commit/b3e91fae80fa6016f0c48884ca0db0f942f2af77"><tt>b3e91fa</tt></a> .<br>
I believe this is a little mistake, and UT is not necessary.</p>
<p dir="auto">As shown below, there is no <code class="notranslate">break</code> statement after <code class="notranslate">SENT</code>, I will send a pr later.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="...
            case DISCONNECTED:
                try {
                    handler.disconnected(channel);
                } catch (Exception e) {
                    logger.warn(&quot;ChannelEventRunnable handle &quot; + state + &quot; operation error, channel is &quot; + channel, e);
                }
                break;
            case SENT:
                try {
                    handler.sent(channel, message);
                } catch (Exception e) {
                    logger.warn(&quot;ChannelEventRunnable handle &quot; + state + &quot; operation error, channel is &quot; + channel
                            + &quot;, message is &quot; + message, e);
                }
               // no break statement here!
            case CAUGHT:
                try {
                    handler.caught(channel, exception);
                } catch (Exception e) {
                    logger.warn(&quot;ChannelEventRunnable handle &quot; + state + &quot; operation error, channel is &quot; + channel
                            + &quot;, message is: &quot; + message + &quot;, exception is &quot; + exception, e);
                }
                break;
            default:
                logger.warn(&quot;unknown state: &quot; + state + &quot;, message is &quot; + message);
            }"><pre class="notranslate"><code class="notranslate">...
            case DISCONNECTED:
                try {
                    handler.disconnected(channel);
                } catch (Exception e) {
                    logger.warn("ChannelEventRunnable handle " + state + " operation error, channel is " + channel, e);
                }
                break;
            case SENT:
                try {
                    handler.sent(channel, message);
                } catch (Exception e) {
                    logger.warn("ChannelEventRunnable handle " + state + " operation error, channel is " + channel
                            + ", message is " + message, e);
                }
               // no break statement here!
            case CAUGHT:
                try {
                    handler.caught(channel, exception);
                } catch (Exception e) {
                    logger.warn("ChannelEventRunnable handle " + state + " operation error, channel is " + channel
                            + ", message is: " + message + ", exception is " + exception, e);
                }
                break;
            default:
                logger.warn("unknown state: " + state + ", message is " + message);
            }
</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: reproduced with 2.7.3, 2.7.8</li>
<li>Operating System version: Windows 10</li>
<li>Java version: 1.8.0</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Register a service with a non-dubbo service name (e.g. <code class="notranslate">user-service</code>) in a Nacos registry</li>
<li>Start a dubbo provider registering to the same Nacos registry</li>
<li>Start a dubbo consumer consuming the service provided by the former provider, with a wildcard selector ('*') in group or version</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">The consumer can initialize and call services successfully.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">The consumer aborted during initialization, with the following exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread &quot;main&quot; org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoServiceComponent': Injection of @DubboReference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to subscribe consumer://192.168.1.241/org.apache.dubbo.demo.DemoService?application=dubbo-demo-annotation-consumer&amp;category=providers,configurators,routers&amp;dubbo=2.0.2&amp;group=*&amp;init=false&amp;interface=org.apache.dubbo.demo.DemoService&amp;methods=sayHello,sayHelloAsync&amp;pid=10232&amp;side=consumer&amp;sticky=false&amp;timestamp=1603163878386, cause: 1
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:146)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.context.annotation.AnnotationConfigApplicationContext.&lt;init&gt;(AnnotationConfigApplicationContext.java:84)
	at org.apache.dubbo.demo.consumer.Application.main(Application.java:34)
Caused by: java.lang.IllegalStateException: Failed to subscribe consumer://192.168.1.241/org.apache.dubbo.demo.DemoService?application=dubbo-demo-annotation-consumer&amp;category=providers,configurators,routers&amp;dubbo=2.0.2&amp;group=*&amp;init=false&amp;interface=org.apache.dubbo.demo.DemoService&amp;methods=sayHello,sayHelloAsync&amp;pid=10232&amp;side=consumer&amp;sticky=false&amp;timestamp=1603163878386, cause: 1
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:350)
	at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:105)
	at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:185)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:469)
	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:449)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:72)
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:161)
	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:356)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:296)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:200)
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:144)
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.getInjectedObject(AbstractAnnotationBeanPostProcessor.java:359)
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement.inject(AbstractAnnotationBeanPostProcessor.java:539)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:142)
	... 12 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.apache.dubbo.registry.nacos.NacosServiceName.&lt;init&gt;(NacosServiceName.java:80)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.apache.dubbo.registry.nacos.NacosRegistry.lambda$filterServiceNames$4(NacosRegistry.java:303)
	at org.apache.dubbo.registry.nacos.NacosRegistry.execute(NacosRegistry.java:583)
	at org.apache.dubbo.registry.nacos.NacosRegistry.filterServiceNames(NacosRegistry.java:295)
	at org.apache.dubbo.registry.nacos.NacosRegistry.getServiceNames0(NacosRegistry.java:286)
	at org.apache.dubbo.registry.nacos.NacosRegistry.getServiceNames(NacosRegistry.java:267)
	at org.apache.dubbo.registry.nacos.NacosRegistry.doSubscribe(NacosRegistry.java:178)
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:333)
	... 27 more"><pre class="notranslate"><code class="notranslate">Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoServiceComponent': Injection of @DubboReference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to subscribe consumer://192.168.1.241/org.apache.dubbo.demo.DemoService?application=dubbo-demo-annotation-consumer&amp;category=providers,configurators,routers&amp;dubbo=2.0.2&amp;group=*&amp;init=false&amp;interface=org.apache.dubbo.demo.DemoService&amp;methods=sayHello,sayHelloAsync&amp;pid=10232&amp;side=consumer&amp;sticky=false&amp;timestamp=1603163878386, cause: 1
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:146)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.context.annotation.AnnotationConfigApplicationContext.&lt;init&gt;(AnnotationConfigApplicationContext.java:84)
	at org.apache.dubbo.demo.consumer.Application.main(Application.java:34)
Caused by: java.lang.IllegalStateException: Failed to subscribe consumer://192.168.1.241/org.apache.dubbo.demo.DemoService?application=dubbo-demo-annotation-consumer&amp;category=providers,configurators,routers&amp;dubbo=2.0.2&amp;group=*&amp;init=false&amp;interface=org.apache.dubbo.demo.DemoService&amp;methods=sayHello,sayHelloAsync&amp;pid=10232&amp;side=consumer&amp;sticky=false&amp;timestamp=1603163878386, cause: 1
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:350)
	at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:105)
	at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:185)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:469)
	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:449)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:72)
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:161)
	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:356)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:296)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:200)
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:144)
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.getInjectedObject(AbstractAnnotationBeanPostProcessor.java:359)
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement.inject(AbstractAnnotationBeanPostProcessor.java:539)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:142)
	... 12 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.apache.dubbo.registry.nacos.NacosServiceName.&lt;init&gt;(NacosServiceName.java:80)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.apache.dubbo.registry.nacos.NacosRegistry.lambda$filterServiceNames$4(NacosRegistry.java:303)
	at org.apache.dubbo.registry.nacos.NacosRegistry.execute(NacosRegistry.java:583)
	at org.apache.dubbo.registry.nacos.NacosRegistry.filterServiceNames(NacosRegistry.java:295)
	at org.apache.dubbo.registry.nacos.NacosRegistry.getServiceNames0(NacosRegistry.java:286)
	at org.apache.dubbo.registry.nacos.NacosRegistry.getServiceNames(NacosRegistry.java:267)
	at org.apache.dubbo.registry.nacos.NacosRegistry.doSubscribe(NacosRegistry.java:178)
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:333)
	... 27 more
</code></pre></div>
<h3 dir="auto">Root Cause</h3>
<p dir="auto">When NacosRegistry tries to subscribe dubbo services with wildcard in group or version, it will fetch and parse all service names from nacos. However the parsing logic made a wrong assumption that all services names conform to the dubbo service format like <code class="notranslate">providers:org.apache.dubbo.demo.DemoService:1.0.0:group1</code>, while there may be other service names like <code class="notranslate">user-service</code> in the registry.</p>