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

this.oldApps = serviceNames;
            this.listener = listener;
        }
        @Override
        public void onEvent(MappingChangedEvent event) {
            if (logger.isDebugEnabled()) {
                logger.debug("Received mapping notification from meta server, " + event);
            }
            Set<String> newApps = event.getApps();
            Set<String> tempOldApps = oldApps;
            oldApps = newApps;
            if (CollectionUtils.isEmpty(newApps)) {
                return;
            }
            if (CollectionUtils.isEmpty(tempOldApps) && newApps.size() > 0) {
                writableMetadataService.putCachedMapping(ServiceNameMapping.buildMappingKey(url), newApps);
                subscribeURLs(url, listener, newApps);
                return;
            }
            for (String newAppName : newApps) {
                if (!tempOldApps.contains(newAppName)) {
                    writableMetadataService.putCachedMapping(ServiceNameMapping.buildMappingKey(url), newApps);
                    subscribeURLs(url, listener, newApps);
                    return;
                }
            }
        }
    }
}