title: Automatic Persistence : Unable to bring up cache with web console generated models : Failed to register query type exception is thrown
body: <p>I used the new Web console to generate the models/artifacts to be used for automatic persistence. </p>
  
  <p>But when i bring up a Spring Boot server with IgniteSpringBean it fails due to a 'query registration issue', below is the stack trace. </p>
  
  <p>I suspect from searching online that some word used in a column is not being accepted by H2 but couldn't figure that out from the exception...does anyone have a clue?</p>
  
  <pre><code>**SEVERE: Got exception while starting (will rollback startup routine).
  class org.apache.ignite.IgniteCheckedException: Failed to register query type: QueryTypeDescriptorImpl [space=DcmEmpCache, name=Emp, tblName=null, fields={}, idxs={}, fullTextIdx=null, keyCls=class java.lang
  .String, valCls=class java.lang.Object, keyTypeName=java.lang.String, valTypeName=com.brocade.dcm.domain.model.Emp, valTextIdx=false, typeId=0, affKey=null, keyFieldName=null, valFieldName=null, obsolete=fal
  se]**
          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.registerType(IgniteH2Indexing.java:1866)
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.registerCache0(GridQueryProcessor.java:1306)
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart0(GridQueryProcessor.java:756)
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:817)
          at org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1265)
          at org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:898)
          at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1013)
          at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1895)
          at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1647)
          at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1075)
          at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:573)
          at org.apache.ignite.IgniteSpring.start(IgniteSpring.java:66)
          at org.apache.ignite.IgniteSpringBean.afterPropertiesSet(IgniteSpringBean.java:159)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
          at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
          at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
          at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
          at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
          at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
          at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
          at com.brocade.dcm.server.ObjectCacheMgrApplication.main(ObjectCacheMgrApplication.java:12)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
          at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
          at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
          at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
  
  **Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "CREATE TABLE ""DcmEmpCache"".EMP (_KEY VARCHAR VISIBLE[*] NOT NULL,_VAL OTHER VISIBLE,_VER OTHER INVISIBLE) ENGINE ""org.apache.ignite.
  internal.processors.query.h2.IgniteH2Indexing$H2TableEngine"" "; expected "(, FOR, UNSIGNED, NOT, NULL, AS, DEFAULT, GENERATED, NOT, NULL, AUTO_INCREMENT, BIGSERIAL, SERIAL, IDENTITY, NULL_TO_DEFAULT, SEQUEN
  CE, SELECTIVITY, COMMENT, CONSTRAINT, PRIMARY, UNIQUE, NOT, NULL, CHECK, REFERENCES, ,, )"; SQL statement:
  CREATE TABLE "DcmEmpCache".Emp (_key VARCHAR VISIBLE NOT NULL,_val OTHER VISIBLE,_ver OTHER INVISIBLE) engine "org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$H2TableEngine" [42001-193]**
          at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
          at org.h2.message.DbException.getSyntaxError(DbException.java:205)
          at org.h2.command.Parser.getSyntaxError(Parser.java:537)
          at org.h2.command.Parser.read(Parser.java:3186)
          at org.h2.command.Parser.readIfMore(Parser.java:885)
          at org.h2.command.Parser.parseCreateTable(Parser.java:6043)
          at org.h2.command.Parser.parseCreate(Parser.java:4238)
          at org.h2.command.Parser.parsePrepared(Parser.java:362)
          at org.h2.command.Parser.parse(Parser.java:317)
          at org.h2.command.Parser.parse(Parser.java:293)
          at org.h2.command.Parser.prepareCommand(Parser.java:254)
          at org.h2.engine.Session.prepareLocal(Session.java:561)
          at org.h2.engine.Session.prepareCommand(Session.java:502)
          at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1203)
          at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:170)
          at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158)
          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$H2TableEngine.createTable(IgniteH2Indexing.java:3975)
          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.createTable(IgniteH2Indexing.java:2006)
          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.registerType(IgniteH2Indexing.java:1859)
          ... 64 more
  </code></pre>
  
  <p>Below is my table schema,</p>
  
  <pre><code>**CREATE TABLE dcm.emp
  (  
  id text NOT NULL,  
  ename text,  
  job text,  
  mgr text,  
  hiredate date,  
  sal integer,  
  comm integer,  
  deptid text,  
  CONSTRAINT pk_emp PRIMARY KEY (id),  
  CONSTRAINT fk_deptid FOREIGN KEY (deptid)  
  REFERENCES dcm.dept (id) MATCH SIMPLE  
  ON UPDATE RESTRICT ON DELETE CASCADE  
  )  
  WITH (  
    OIDS=FALSE  
  );  
  ALTER TABLE dcm.emp  
  OWNER TO postgres;**
  </code></pre>
  
  <p>Regards,<br>
  Muthu</p>
  
  <p>UPDATE (Aug 08 2017) : I still get errors with the latest 2.1 version,</p>
  
  <pre><code>INFO: Started cache [name=ignite-sys-cache, memoryPolicyName=sysMemPlc, mode=REPLICATED, atomicity=TRANSACTIONAL]
  Aug 03, 2017 12:34:36 PM org.apache.ignite.logger.java.JavaLogger error
  SEVERE: Failed to reinitialize local partitions (preloading will be stopped): GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=1, minorTopVer=0], nodeId=e9b2cf46, evt=NODE_JOINED]
  class org.apache.ignite.IgniteCheckedException: Failed to register query type: QueryTypeDescriptorImpl [cacheName=DeptCache, name=Dept, tblName=DEPT, fields={DNAME=class java.lang.String, LOC=class java.lang
  .String, DEPTID=class java.lang.String}, idxs={}, fullTextIdx=null, keyCls=class java.lang.String, valCls=class java.lang.Object, keyTypeName=java.lang.String, valTypeName=com.brocade.dcm.domain.model.Dept,
  valTextIdx=false, typeId=1038936471, affKey=null, keyFieldName=deptid, valFieldName=null, obsolete=false]
          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.registerType(IgniteH2Indexing.java:1532)
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.registerCache0(GridQueryProcessor.java:1424)
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart0(GridQueryProcessor.java:784)
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:845)
          at org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1185)
          at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1884)
          at org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCachesOnLocalJoin(GridCacheProcessor.java:1755)
          at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:619)
          at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1901)
          at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
          at java.lang.Thread.run(Unknown Source)
  Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "CREATE TABLE ""DEPTS"".""DEPT"" (_KEY VARCHAR INVISIBLE[*] NOT NULL,_VAL OTHER INVISIBLE,_VER OTHER INVISIBLE,""DNAME"" VARCHAR,""LOC""
   VARCHAR,""DEPTID"" VARCHAR) ENGINE ""org.apache.ignite.internal.processors.query.h2.H2TableEngine"" "; expected "(, FOR, UNSIGNED, NOT, NULL, AS, DEFAULT, GENERATED, NOT, NULL, AUTO_INCREMENT, BIGSERIAL, SE
  RIAL, IDENTITY, NULL_TO_DEFAULT, SEQUENCE, SELECTIVITY, COMMENT, CONSTRAINT, PRIMARY, UNIQUE, NOT, NULL, CHECK, REFERENCES, ,, )"; SQL statement:
  CREATE TABLE "DEPTS"."DEPT" (_KEY VARCHAR INVISIBLE NOT NULL,_VAL OTHER INVISIBLE,_VER OTHER INVISIBLE,"DNAME" VARCHAR,"LOC" VARCHAR,"DEPTID" VARCHAR) engine "org.apache.ignite.internal.processors.query.h2.H
  2TableEngine" [42001-193]
          at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
          at org.h2.message.DbException.getSyntaxError(DbException.java:205)
          at org.h2.command.Parser.getSyntaxError(Parser.java:537)
          at org.h2.command.Parser.read(Parser.java:3186)
          at org.h2.command.Parser.readIfMore(Parser.java:885)
          at org.h2.command.Parser.parseCreateTable(Parser.java:6043)
          at org.h2.command.Parser.parseCreate(Parser.java:4238)
          at org.h2.command.Parser.parsePrepared(Parser.java:362)
          at org.h2.command.Parser.parse(Parser.java:317)
          at org.h2.command.Parser.parse(Parser.java:293)
          at org.h2.command.Parser.prepareCommand(Parser.java:254)
          at org.h2.engine.Session.prepareLocal(Session.java:561)
          at org.h2.engine.Session.prepareCommand(Session.java:502)
          at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1203)
          at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:170)
          at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158)
          at org.apache.ignite.internal.processors.query.h2.H2TableEngine.createTable(H2TableEngine.java:68)
          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.createTable(IgniteH2Indexing.java:1606)
          at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.registerType(IgniteH2Indexing.java:1525)
          ... 10 more
  </code></pre>
  
  <p>Any clue?</p>