diff --git a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java index d64ff32000..6e2608f48d 100644 --- a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java +++ b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java @@ -15,9 +15,6 @@ */ package org.springframework.data.mapping.context; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -34,6 +31,8 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.BeansException; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; @@ -281,10 +280,10 @@ protected E addPersistentEntity(TypeInformation typeInformation) { // Eagerly cache the entity as we might have to find it during recursive lookups. persistentEntities.put(typeInformation, entity); - BeanInfo info = Introspector.getBeanInfo(type); + PropertyDescriptor[] pds = BeanUtils.getPropertyDescriptors(type); final Map descriptors = new HashMap(); - for (PropertyDescriptor descriptor : info.getPropertyDescriptors()) { + for (PropertyDescriptor descriptor : pds) { descriptors.put(descriptor.getName(), descriptor); } @@ -308,7 +307,7 @@ protected E addPersistentEntity(TypeInformation typeInformation) { return entity; - } catch (IntrospectionException e) { + } catch (BeansException e) { throw new MappingException(e.getMessage(), e); } finally { write.unlock();