diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/repository/core/support/RepositoryInterfaceAwareBeanPostProcessor.java b/spring-data-commons-core/src/main/java/org/springframework/data/repository/core/support/RepositoryInterfaceAwareBeanPostProcessor.java index c77c193ae..d53d3cc3b 100644 --- a/spring-data-commons-core/src/main/java/org/springframework/data/repository/core/support/RepositoryInterfaceAwareBeanPostProcessor.java +++ b/spring-data-commons-core/src/main/java/org/springframework/data/repository/core/support/RepositoryInterfaceAwareBeanPostProcessor.java @@ -18,6 +18,8 @@ package org.springframework.data.repository.core.support; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.beans.PropertyValue; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; @@ -37,7 +39,8 @@ import org.springframework.util.ClassUtils; */ class RepositoryInterfaceAwareBeanPostProcessor extends InstantiationAwareBeanPostProcessorAdapter implements BeanFactoryAware { - + + private static final Log LOG = LogFactory.getLog(RepositoryInterfaceAwareBeanPostProcessor.class); private static final Class REPOSITORY_TYPE = RepositoryFactoryBeanSupport.class; private final Map> cache = new ConcurrentHashMap>(); @@ -74,7 +77,7 @@ class RepositoryInterfaceAwareBeanPostProcessor extends InstantiationAwareBeanPo return cache.get(beanName); } - resolvedBeanClass = getClassForPropertyValue(value); + resolvedBeanClass = getClassForPropertyValue(value, beanName); cache.put(beanName, resolvedBeanClass); return resolvedBeanClass == Void.class ? null : resolvedBeanClass; @@ -85,9 +88,10 @@ class RepositoryInterfaceAwareBeanPostProcessor extends InstantiationAwareBeanPo * {@link TypedStringValue} or the value contained cannot be interpreted as {@link Class} it will return null. * * @param propertyValue + * @param beanName * @return */ - private Class getClassForPropertyValue(PropertyValue propertyValue) { + private Class getClassForPropertyValue(PropertyValue propertyValue, String beanName) { Object value = propertyValue.getValue(); String className = null; @@ -105,6 +109,8 @@ class RepositoryInterfaceAwareBeanPostProcessor extends InstantiationAwareBeanPo try { return ClassUtils.resolveClassName(className, RepositoryInterfaceAwareBeanPostProcessor.class.getClassLoader()); } catch (IllegalArgumentException ex) { + LOG.warn(String.format("Couldn't load class %s referenced as repository interface in bean %s!", className, + beanName)); return Void.class; } }