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

protected final Logger logger = LoggerFactory.getLogger(getClass());
    private final ServiceDiscovery serviceDiscovery;
    private final WritableMetadataService writableMetadataService;
    private final Set<String> registeredListeners = new LinkedHashSet<>();
    
    private final Map<String, ServiceInstancesChangedListener> serviceListeners = new ConcurrentHashMap<>();
    private URL registryURL;
    private RegistryManager registryManager;
    public ServiceDiscoveryRegistry(URL registryURL) {
        this.registryURL = registryURL;
        this.serviceDiscovery = createServiceDiscovery(registryURL);
        this.writableMetadataService = WritableMetadataService.getDefaultExtension(registryURL.getScopeModel());
        this.registryManager = registryURL.getOrDefaultApplicationModel().getBeanFactory().getBean(RegistryManager.class);
    }
    
    protected ServiceDiscoveryRegistry(URL registryURL, ServiceDiscovery serviceDiscovery, WritableMetadataService writableMetadataService) {
        this.registryURL = registryURL;
        this.serviceDiscovery = serviceDiscovery;
        this.writableMetadataService = writableMetadataService;
    }
    public ServiceDiscovery getServiceDiscovery() {
        return serviceDiscovery;
    }
    /**
     * Create the {@link ServiceDiscovery} from the registry {@link URL}
     *
     * @param registryURL the {@link URL} to connect the registry