Uploaded image for project: 'Spring Data GemFire'
  1. Spring Data GemFire
  2. SGF-700

From clause Region path error occurs when creating Indexes from application domain object fields annotated with @Indexed or @Id

    XMLWordPrintable

    Details

    • Sprint:
      Kay SR1, Lovelace M1

      Description

      When defining Indexes via SDG mapping annotations on application domain object properties/fields without an explicit from clause specified, as in...

      @Region("Customers")
      class Customer {
      
          @Id
          Long id;
      
          @Indexed
          String name;
      
          ...
      }
      

      Rather than...

      @Region("Customers")
      class Customer {
      
          @Id
          Long id;
      
          @Indexed(from = "/Customers")
          String name;
      
          ...
      }
      

      The Spring container, and specifically Apache Geode fails to bootstrap and initialize properly, which is caused by the following Exception...

      Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
      2017-11-27 12:58:00.121 ERROR 57544 --- [           main] o.s.boot.SpringApplication               : Application startup failed
      
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CustomersIdKeyIdx': Invocation of init method failed; nested exception is org.springframework.data.gemfire.GemfireIndexException: Failed to create Index [{ name = 'CustomersIdKeyIdx', expression = 'id', from = 'Customers', imports = 'null', type = KEY }]; nested exception is org.apache.geode.cache.query.RegionNotFoundException: DefaultQueryService::createIndex:First Iterator of Index >From Clause does not evaluate to a Region Path. The from clause used for Index creation is  Customers
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1710) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
      	at example.app.SpringBootApacheGeodeClientApplication.main(SpringBootApacheGeodeClientApplication.java:33) [classes/:na]
      Caused by: org.springframework.data.gemfire.GemfireIndexException: Failed to create Index [{ name = 'CustomersIdKeyIdx', expression = 'id', from = 'Customers', imports = 'null', type = KEY }]; nested exception is org.apache.geode.cache.query.RegionNotFoundException: DefaultQueryService::createIndex:First Iterator of Index >From Clause does not evaluate to a Region Path. The from clause used for Index creation is  Customers
      	at org.springframework.data.gemfire.IndexFactoryBean.createIndex(IndexFactoryBean.java:340) ~[spring-data-geode-2.0.2.RELEASE.jar:2.0.2.RELEASE]
      	at org.springframework.data.gemfire.IndexFactoryBean.createIndex(IndexFactoryBean.java:234) ~[spring-data-geode-2.0.2.RELEASE.jar:2.0.2.RELEASE]
      	at org.springframework.data.gemfire.IndexFactoryBean.afterPropertiesSet(IndexFactoryBean.java:120) ~[spring-data-geode-2.0.2.RELEASE.jar:2.0.2.RELEASE]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1769) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      	... 15 common frames omitted
      Caused by: org.apache.geode.cache.query.RegionNotFoundException: DefaultQueryService::createIndex:First Iterator of Index >From Clause does not evaluate to a Region Path. The from clause used for Index creation is  Customers
      	at org.apache.geode.cache.query.internal.DefaultQueryService.getRegionFromPath(DefaultQueryService.java:236) ~[geode-core-1.2.1.jar:na]
      	at org.apache.geode.cache.query.internal.DefaultQueryService.createIndex(DefaultQueryService.java:168) ~[geode-core-1.2.1.jar:na]
      	at org.apache.geode.cache.query.internal.DefaultQueryService.createIndex(DefaultQueryService.java:153) ~[geode-core-1.2.1.jar:na]
      	at org.apache.geode.cache.query.internal.DefaultQueryService.createIndex(DefaultQueryService.java:218) ~[geode-core-1.2.1.jar:na]
      	at org.apache.geode.cache.query.internal.DefaultQueryService.createKeyIndex(DefaultQueryService.java:141) ~[geode-core-1.2.1.jar:na]
      	at org.springframework.data.gemfire.IndexFactoryBean.createKeyIndex(IndexFactoryBean.java:438) ~[spring-data-geode-2.0.2.RELEASE.jar:2.0.2.RELEASE]
      	at org.springframework.data.gemfire.IndexFactoryBean.createIndex(IndexFactoryBean.java:248) ~[spring-data-geode-2.0.2.RELEASE.jar:2.0.2.RELEASE]
      	... 19 common frames omitted
      

        Attachments

          Activity

            People

            Assignee:
            jblum John Blum
            Reporter:
            jblum John Blum
            Last updater:
            Mark Paluch Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: