### Environment

* Dubbo version: 2.7.6-SNAPSHOT
* Operating System version: Mac
* Java version: 1.8

### Steps to reproduce this issue

run dubbo-samples-simplified-registry-xml 

org.apache.dubbo.samples.simplified.registry.xml.DemoServiceIT
### Expected Result

should pass

### Actual Result

throw exception
private static final Logger logger = LoggerFactory.getLogger(RegistryDirectory.class);
    private static final Cluster CLUSTER = ExtensionLoader.getExtensionLoader(Cluster.class).getAdaptiveExtension();
    private static final RouterFactory ROUTER_FACTORY = ExtensionLoader.getExtensionLoader(RouterFactory.class)
            .getAdaptiveExtension();
    private final String serviceKey; 
    private final Class<T> serviceType; 
    private final Map<String, String> queryMap; 
    private final URL directoryUrl; 
    private final boolean multiGroup;
    private Protocol protocol; 
    private Registry registry; 
    private volatile boolean forbidden = false;
    private boolean shouldRegister;
    private boolean shouldSimplified;
    private volatile URL overrideDirectoryUrl;