You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "kathetina (GitHub)" <gi...@apache.org> on 2019/08/15 07:42:44 UTC

[GitHub] [dubbo] kathetina opened issue #4833: [Finalizer] WARN org.apache.dubbo.config.ReferenceConfig$1 (ReferenceConfig.java:182) - [DUBBO] ReferenceConfig(null) is not DESTROYED when FINALIZE, dubbo version: 2.7.2


* Dubbo version: 2.7.2
* Java version: 1.8

Code:
public static <T> T getBeanByGroup(Class<T> bean, String group) throws RuntimeException {
		T service = null;
		try {
               // 引用远程服务
		ReferenceConfig<T> reference = new ReferenceConfig<T>();
			reference.setInterface(bean);
			// reference.setVersion("");
			// 服务分组
			if (!StringUtil.isEmpty(group)) {
				reference.setGroup(group);
			}
			// 当前消费者应用配置
			ApplicationConfig application = new ApplicationConfig(getAppName());
			reference.setApplication(application);
			reference.setRegistry(registry);
			// 缓存reference实例
			ReferenceConfigCache referenceConfigCache =    ReferenceConfigCache.getCache();
			service =  referenceConfigCache.get(reference);
		} catch (Exception e) {
			throw new RuntimeException(e.getMessage());
		}
		return service;
	}

Appearance:
<img width="1435" alt="image" src="https://user-images.githubusercontent.com/8829397/63080215-21c1bd00-bf73-11e9-8c99-0bd6afbf04c2.png">



[ Full content available at: https://github.com/apache/dubbo/issues/4833 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org