- [*] 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
```

* @return non-null
     */
    protected ServiceDiscovery createServiceDiscovery(URL registryURL) {
        ServiceDiscovery serviceDiscovery = getServiceDiscovery(registryURL);
        execute(() -> serviceDiscovery.initialize(registryURL.addParameter(INTERFACE_KEY, ServiceDiscovery.class.getName())
            .removeParameter(REGISTRY_TYPE_KEY)));
        return serviceDiscovery;
    }
    private List<SubscribedURLsSynthesizer> initSubscribedURLsSynthesizers() {
        ExtensionLoader<SubscribedURLsSynthesizer> loader = getUrl().getOrDefaultApplicationModel().getExtensionLoader(SubscribedURLsSynthesizer.class);
        return Collections.unmodifiableList(new ArrayList<>(loader.getSupportedExtensionInstances()));
    }
    /**
     * Get the instance {@link ServiceDiscovery} from the registry {@link URL} using
     * {@link ServiceDiscoveryFactory} SPI
     *
     * @param registryURL the {@link URL} to connect the registry
     * @return
     */
    private ServiceDiscovery getServiceDiscovery(URL registryURL) {
        ServiceDiscoveryFactory factory = getExtension(registryURL);
        return factory.getServiceDiscovery(registryURL);
    }
    protected boolean shouldRegister(URL providerURL) {
        String side = providerURL.getSide();
        boolean should = PROVIDER_SIDE.equals(side); 
        if (!should) {
            if (logger.isDebugEnabled()) {
                logger.debug(String.format("The URL[%s] should not be registered.", providerURL));
            }