* 启动provider

dubbo-demo-api-provider

* 启动consumer

dubbo-demo-api-consumer

consumer设置generic

```java
    public static void main(String[] args) {
        ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
        reference.setApplication(new ApplicationConfig("dubbo-demo-api-consumer"));
        reference.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
        reference.setInterface(DemoService.class);
        reference.setGeneric(true);
        
        Object obj = reference.get();
        for(Class c : obj.getClass().getInterfaces()) {
            System.err.println(c);
        }
        DemoService service = reference.get();
        String message = service.sayHello("dubbo");
        System.out.println(message);
    }
```

客户端会报错：

```
Exception in thread "main" java.lang.ClassCastException: org.apache.dubbo.common.bytecode.proxy0 cannot be cast to org.apache.dubbo.demo.DemoService
	at org.apache.dubbo.demo.consumer.Application.main(Application.java:42)
```
invoker = CLUSTER.join(new StaticDirectory(invokers));
                }
            }
        }
        if (shouldCheck() && !invoker.isAvailable()) {
            throw new IllegalStateException("Failed to check the status of the service "
                    + interfaceName
                    + ". No provider available for the service "
                    + (group == null ? "" : group + "/")
                    + interfaceName +
                    (version == null ? "" : ":" + version)
                    + " from the url "
                    + invoker.getUrl()
                    + " to the consumer "
                    + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion());
        }
        if (logger.isInfoEnabled()) {
            logger.info("Refer dubbo service " + interfaceClass.getName() + " from url " + invoker.getUrl());
        }
        /**
         * @since 2.7.0
         * ServiceData Store
         */
        String metadata = map.get(METADATA_KEY);
        WritableMetadataService metadataService = WritableMetadataService.getExtension(metadata == null ? DEFAULT_METADATA_STORAGE_TYPE : metadata);
        if (metadataService != null) {
            URL consumerURL = new URL(CONSUMER_PROTOCOL, map.remove(REGISTER_IP_KEY), 0, map.get(INTERFACE_KEY), map);
            metadataService.publishServiceDefinition(consumerURL);
        }
        //