- [*] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [*] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 3.0.2.1
* Operating System version: Ubuntu20
* Java version: 1.8

### Steps to reproduce this issue

1.  telnet localhost 22222
2. dubbo>ls service


Pls. provide [GitHub address] to reproduce this issue.

### Expected Result
list services

### Actual Result

```
ls service :fail to execute commandContext by org.apache.dubbo.registry.client.ServiceDiscoveryRegistry cannot be cast to org.apache.dubbo.registry.support.AbstractRegistry
```

serviceNames = new TreeSet<>(serviceNames);
        String serviceNamesKey = toStringKeys(serviceNames);
        String protocolServiceKey = url.getServiceKey() + GROUP_CHAR_SEPARATOR + url.getParameter(PROTOCOL_KEY, DUBBO);
        
        boolean serviceListenerRegistered = true;
        ServiceInstancesChangedListener serviceInstancesChangedListener;
        synchronized (this) {
            serviceInstancesChangedListener = serviceListeners.get(serviceNamesKey);
            if (serviceInstancesChangedListener == null) {
                serviceInstancesChangedListener = serviceDiscovery.createListener(serviceNames);
                serviceInstancesChangedListener.setUrl(url);
                for (String serviceName : serviceNames) {
                    List<ServiceInstance> serviceInstances = serviceDiscovery.getInstances(serviceName);
                    if (CollectionUtils.isNotEmpty(serviceInstances)) {
                        serviceInstancesChangedListener.onEvent(new ServiceInstancesChangedEvent(serviceName, serviceInstances));
                    }
                }
                serviceListenerRegistered = false;
                serviceListeners.put(serviceNamesKey, serviceInstancesChangedListener);
            }
        }
        serviceInstancesChangedListener.setUrl(url);
        listener.addServiceListener(serviceInstancesChangedListener);
        serviceInstancesChangedListener.addListenerAndNotify(protocolServiceKey, listener);
        if (!serviceListenerRegistered) {
            serviceDiscovery.addServiceInstancesChangedListener(serviceInstancesChangedListener);
        }
    }
    /**
     * Create an instance of {@link ServiceDiscoveryRegistry} if supported