PDA

View Full Version : Unable to insatiate Gemfire cache using Spring-Gemfire intergration



mohitm
May 25th, 2011, 05:14 AM
Hi

I am trying to use Spring - Gemfire integration
To start I want to create cache object using org.springframework.data.gemfire.CacheFactoryBean
I am using Spring 3.0, Spring-Gemfire 1.0.0 and gemfire 6.5.0 in my project
Here is my code to instantiate CacheFacotryBean.


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="cache" class="org.springframework.data.gemfire.CacheFactoryBean">
<property name="properties">
<props>
<prop key="cache-xml-file">peer-empty-cache.xml</prop>
<prop key="mcast-port">0</prop>
</props>
</property>
</bean>
If I try to instantiate context getting error as


Caused by: java.lang.reflect.MalformedParameterizedTypeExcept ion
at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.validateConstructorArguments(Parameteri zedTypeImpl.java:42)
at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.<init>(ParameterizedTypeImpl.java:35)
at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.make(ParameterizedTypeImpl.java:77)
at sun.reflect.generics.factory.CoreReflectionFactory .makeParameterizedType(CoreReflectionFactory.java: 86)
at sun.reflect.generics.visitor.Reifier.visitClassTyp eSignature(Reifier.java:122)
at sun.reflect.generics.tree.ClassTypeSignature.accep t(ClassTypeSignature.java:31)
at sun.reflect.generics.repository.ClassRepository.ge tSuperInterfaces(ClassRepository.java:82)
at java.lang.Class.getGenericInterfaces(Class.java:79 4)
at org.springframework.core.GenericTypeResolver.getTy peVariableMap(GenericTypeResolver.java:151)
at org.springframework.core.GenericTypeResolver.resol veParameterType(GenericTypeResolver.java:81)
at org.springframework.beans.GenericTypeAwareProperty Descriptor.getWriteMethodParameter(GenericTypeAwar ePropertyDescriptor.java:109)
at org.springframework.beans.GenericTypeAwareProperty Descriptor.getPropertyType(GenericTypeAwarePropert yDescriptor.java:91)
at org.springframework.beans.TypeConverterDelegate.co nvertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertF orProperty(BeanWrapperImpl.java:386)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.convertForProperty(Abst ractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:472)
... 14 more

As I have just started working on Spring-Gemfire integration,I will be overwhelmed if you can help .

vboulaye
Jun 17th, 2011, 08:10 AM
Hi,

might be a bit late, but I just encountered the same exception while migrating an application from spring 2.5.6 to spring 3.0.5.RELEASE

In my case, the problem was coming from a transitive dependency in the pom.xml that would still retrieve a spring 2.5.6 jar in the middle of all the 3.0.5 ones.
Setting all spring module dependencies version to the 3.0.5.RELEASE version in the project pom fixed the issue.