diff --git a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java index 4a33599e..5e4ec24c 100644 --- a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java @@ -22,6 +22,7 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.data.gemfire.RegionFactoryBean; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Region; @@ -55,15 +56,17 @@ public class ClientRegionFactoryBean extends RegionFactoryBean imple @Override protected void postProcess(AttributesFactory attrFactory) { - // try to eagerly initialize the pool name, if defined as a bean - if (beanFactory.isTypeMatch(poolName, Pool.class)) { - if (log.isDebugEnabled()) { - log.debug("Found bean definition for pool '" + poolName + "'. Eagerly initializing it..."); + if (StringUtils.hasText(poolName)) { + // try to eagerly initialize the pool name, if defined as a bean + if (beanFactory.isTypeMatch(poolName, Pool.class)) { + if (log.isDebugEnabled()) { + log.debug("Found bean definition for pool '" + poolName + "'. Eagerly initializing it..."); + } + beanFactory.getBean(poolName, Pool.class); } - beanFactory.getBean(poolName, Pool.class); - } - attrFactory.setPoolName(poolName); + attrFactory.setPoolName(poolName); + } } @Override @@ -93,7 +96,7 @@ public class ClientRegionFactoryBean extends RegionFactoryBean imple this.beanFactory = beanFactory; } - + /** * Set the interests for this client region. Both key and regex interest are supported. *