### Environment

* Dubbo version: 2.7.4.1
* Operating System version: Win7
* Java version: jdk8

### Steps to reproduce this issue

1. Dubbo 2.7.4.1 Use zookeeper registry, generic call reports an error: 'zookeeper not connected '.
2. Dubbo 2.7.3 no such problem

### Expected Result

Interface accessed successfully

### Actual Result

java.lang.IllegalStateException: zookeeper not connected

If there is an exception, please attach the exception trace:

```
java.lang.IllegalStateException: zookeeper not connected

	at org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.<init>(CuratorZookeeperClient.java:83)
	at org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter.createZookeeperClient(CuratorZookeeperTransporter.java:26)
	at org.apache.dubbo.remoting.zookeeper.support.AbstractZookeeperTransporter.connect(AbstractZookeeperTransporter.java:68)
	at org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter$Adaptive.connect(ZookeeperTransporter$Adaptive.java)
	at org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfiguration.<init>(ZookeeperDynamicConfiguration.java:62)
	at org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfigurationFactory.createDynamicConfiguration(ZookeeperDynamicConfigurationFactory.java:37)
	at org.apache.dubbo.configcenter.AbstractDynamicConfigurationFactory.getDynamicConfiguration(AbstractDynamicConfigurationFactory.java:33)
	at org.apache.dubbo.config.AbstractInterfaceConfig.getDynamicConfiguration(AbstractInterfaceConfig.java:315)
	at org.apache.dubbo.config.AbstractInterfaceConfig.prepareEnvironment(AbstractInterfaceConfig.java:290)
	at org.apache.dubbo.config.AbstractInterfaceConfig.startConfigCenter(AbstractInterfaceConfig.java:280)
	at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$null$7(AbstractInterfaceConfig.java:636)
	at org.apache.dubbo.config.AbstractInterfaceConfig$$Lambda$38/1374066265.get(Unknown Source)
	at java.util.Optional.orElseGet(Optional.java:267)
	at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$useRegistryForConfigIfNecessary$8(AbstractInterfaceConfig.java:620)
	at org.apache.dubbo.config.AbstractInterfaceConfig$$Lambda$37/1704237553.accept(Unknown Source)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.apache.dubbo.config.AbstractInterfaceConfig.useRegistryForConfigIfNecessary(AbstractInterfaceConfig.java:618)
	at org.apache.dubbo.config.AbstractInterfaceConfig.checkRegistry(AbstractInterfaceConfig.java:208)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:378)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:329)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:250)
```

### Sample code

```
ApplicationConfig application = new ApplicationConfig();
application.setName("api-generic-consumer");
ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
reference.setVersion("1.0.0");
RegistryConfig registry = new RegistryConfig();
registry.setProtocol(Constants.REGISTRY_ZOOKEEPER);
registry.setAddress("192.168.0.58:2181,192.168.0.59:2181,192.168.0.60:2181");
reference.setRegistry(registry);
reference.setTimeout(2000);
reference.setGeneric(true);
reference.setApplication(application);
reference.setInterface("com.xxxxx.api.IXxxService");
GenericService genericService = reference.get();
Object obj = genericService.$invoke("getXxx", new String[]{Long.class.getName()}, new Long[]{1L});
String json = JsonUtils.toJson(obj);
System.out.println(json);
```
}
    private DubboBootstrap() {
        configManager = ApplicationModel.getConfigManager();
        environment = ApplicationModel.getEnvironment();
        DubboShutdownHook.getDubboShutdownHook().register();
        ShutdownHookCallbacks.INSTANCE.addCallback(new ShutdownHookCallback() {
            @Override
            public void callback() throws Throwable {
                DubboBootstrap.this.destroy();
            }
        });
    }
    public void unRegisterShutdownHook() {
        DubboShutdownHook.getDubboShutdownHook().unregister();
    }
    private boolean isOnlyRegisterProvider() {
        Boolean registerConsumer = getApplication().getRegisterConsumer();
        return registerConsumer == null || !registerConsumer;
    }
    private String getMetadataType() {
        String type = getApplication().getMetadataType();
        if (StringUtils.isEmpty(type)) {
            type = DEFAULT_METADATA_STORAGE_TYPE;
        }
        return type;
    }
    public DubboBootstrap metadataReport(MetadataReportConfig metadataReportConfig) {
        configManager.addMetadataReport(metadataReportConfig);
        return this;
    }