I tried to define an index in the spring-cache-server.xml:
<!-- region -->
<gfe:partitioned-region id="MyPartitionRegion" cache-ref="cache">
</gfe:partitioned-region>
<!-- index -->
<gfe:index id="myIndex" type="PRIMARY_KEY" cache-ref="cache"
expression="testId" from="/MyPartitionRegion" />
When I start the first server ,everything is OK.
When I start the second or the third server ,sometimes there's nothing wrong with it,but sometimes here comes the error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myIndex': Invocation of init method failed; nested exception is com.gemstone.gemfire.cache.query.IndexNameConflict Exception: Index named ' myIndex ' already exists.
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:567)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:913)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
What should I do with the index...


Reply With Quote
