Announcement Announcement Module
Collapse
No announcement yet.
how to define a GemFire index with xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to define a GemFire index with xml

    I tried to define an index in the spring-cache-server.xml:
    <!-- region -->
    <gfeartitioned-region id="MyPartitionRegion" cache-ref="cache">
    </gfeartitioned-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...

  • #2
    Can you post your cache config?

    Comment


    • #3
      spring-cache-server.xml:

      <!-- cache -->
      <gfe:cache id="cache" properties-ref="props"
      cache-xml-location="classpath:cache-server.xml" />



      cache-server.xml:

      <!DOCTYPE cache PUBLIC
      "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.6//EN"
      "http://www.gemstone.com/dtd/cache6_6.dtd">
      <cache is-server="true">
      <function-service>
      <function>
      <class-name>........</class-name>
      </function>
      <function>
      <class-name>........</class-name>
      </function>
      </function-service>
      </cache>

      Comment


      • #4
        It looks like a bug but I am unable to reproduce the problem with a simple cache configuration with 2 instances running locally on different ports. It would help to see your property settings, logs, etc.

        Comment


        • #5
          I've got two servers and some regions persist to disk.
          When I start the second server after the first server has already started, it's OK.
          When I restart these servers, they recovered data from disk. So they started at the same time, and the second server failed to start.

          However now I use API to create index instead, and it works.

          Comment


          • #6
            OK. I created a JIRA for this https://jira.springsource.org/browse/SGF-94

            Comment


            • #7
              Thanks~

              Comment

              Working...
              X