Hello,
Can you provide more information about your test steps and share the whole your unit test with us? For instance, in your stack trace, the `GridCacheDatabaseSharedManager` used. So, node expects persistence to be enabled and it's not clear for me why. Please, share details. On Sun, 23 Sep 2018 at 21:07 kcheng.mvp <[hidden email]> wrote: > I ran into this error with below configuration(IgniteSpringBean) > > I set * defaultDataRegionConfiguration* as * <property > name="persistenceEnabled" value="false"/>* for unit test. If I set this to > true then everything goes well. > > > <property name="dataStorageConfiguration"> > <bean > class="org.apache.ignite.configuration.DataStorageConfiguration"> > > <property name="storagePath" > value="${ignite.storage.storagePath}"/> > <property name="walPath" > value="${ignite.storage.walPath}"/> > <property name="walArchivePath" > value="${ignite.storage.walArchivePath}"/> > > <property name="dataRegionConfigurations"> > <list> > <bean > class="org.apache.ignite.configuration.DataRegionConfiguration"> > <property name="name" value="r20g"/> > <property name="initialSize" > value='#{${ignite.storage.dataRegion.region_uat.initialSize}}'/> > <property name="maxSize" > value='#{${ignite.storage.dataRegion.region_uat.maxSize}}'/> > * <property name="persistenceEnabled" > value="true"/>* > </bean> > <bean > class="org.apache.ignite.configuration.DataRegionConfiguration"> > <property name="name" value="r5g"/> > <property name="initialSize" > value='#{${ignite.storage.dataRegion.region_sc.initialSize}}'/> > <property name="maxSize" > value='#{${ignite.storage.dataRegion.region_sc.maxSize}}'/> > * <property name="persistenceEnabled" > value="true"/>* > </bean> > </list> > </property> > <property name="defaultDataRegionConfiguration"> > <bean > class="org.apache.ignite.configuration.DataRegionConfiguration"> > <property name="name" value="Default_Region"/> > > <property name="maxSize" value="#{40L * 1024 * > 1024}"/> > * <property name="persistenceEnabled" > value="false"/>* > </bean> > </property> > </bean> > </property> > > > > > here is the full error stack > > > Caused by: class org.apache.ignite.IgniteException: Failed to activate > cluster > at > > org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:990) > at > > org.apache.ignite.internal.cluster.IgniteClusterImpl.active(IgniteClusterImpl.java:315) > at > org.apache.ignite.internal.IgniteKernal.active(IgniteKernal.java:3399) > at > org.apache.ignite.IgniteSpringBean.active(IgniteSpringBean.java:615) > at > com.nfhd.data.Application.lambda$commandLineRunner$0(Application.java:90) > at > > org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:797) > ... 30 more > Caused by: class org.apache.ignite.IgniteCheckedException: Failed to > activate cluster > Suppressed: java.lang.ClassCastException: > org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl cannot be > cast > to > > org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryEx > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.getPageMemoryForCacheGroup(GridCacheDatabaseSharedManager.java:2154) > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreMemory(GridCacheDatabaseSharedManager.java:2007) > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreMemory(GridCacheDatabaseSharedManager.java:1929) > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.readCheckpointAndRestoreMemory(GridCacheDatabaseSharedManager.java:755) > at > > org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onClusterStateChangeRequest(GridDhtPartitionsExchangeFuture.java:894) > at > > org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:641) > at > > org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:2419) > at > > org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2299) > at > org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) > at java.lang.Thread.run(Thread.java:748) > > > > > -- > Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/ > -- Maxim Muzafarov |
I am using springboot + ignite. it's very simple.
you can reproduce this issue with below code Bean definition ----------------------------------------- @Bean public CommandLineRunner commandLineRunner(@Autowired ApplicationContext context) { return args -> { logger.info("Start ignite database ......"); logger.info("Region name is: {}", regionName); IgniteSpringBean igniteSpringBean = context.getBean("igniteSpringBean", IgniteSpringBean.class); igniteSpringBean.active(true); logger.info("Init ignite database ......"); CacheConfiguration cacheCfg = cacheCfg(); logger.info("Cache name is {}", cacheCfg.getName()); cacheCfg.setIndexedTypes(String.class, Article.class, ArticleAffKey.class, Comment.class, CommentAffKey.class, Reply.class); igniteSpringBean.getOrCreateCache(cacheCfg); }; } @Bean public CacheConfiguration cacheCfg() { CacheConfiguration cacheCfg = new CacheConfiguration<>(IgDef.DOCS); cacheCfg.setBackups(1); cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC); if (!Arrays.asList(environment.getActiveProfiles()).contains("test")) { cacheCfg.setDataRegionName(regionName); } return cacheCfg; } ------------------------------ ignite.xml --------------------- <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> <bean id="igniteSpringBean" class="org.apache.ignite.IgniteSpringBean"> <property name="configuration" ref="igcfg"/> </bean> <bean id="igcfg" class="org.apache.ignite.configuration.IgniteConfiguration"> <property name="clientMode" value="${ignite.clientMode}"/> <property name="discoverySpi"> <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> <property name="ipFinder"> <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> <property name="addresses" value="#{'${ignite.TcpDiscoverySpi.addresses}'.split(',')}"/> </bean> </property> </bean> </property> <property name="dataStorageConfiguration"> <bean class="org.apache.ignite.configuration.DataStorageConfiguration"> <property name="storagePath" value="${ignite.storage.storagePath}"/> <property name="walPath" value="${ignite.storage.walPath}"/> <property name="walArchivePath" value="${ignite.storage.walArchivePath}"/> <property name="dataRegionConfigurations"> <list> <bean class="org.apache.ignite.configuration.DataRegionConfiguration"> <property name="name" value="r20g"/> <property name="initialSize" value='#{${ignite.storage.dataRegion.region_uat.initialSize}}'/> <property name="maxSize" value='#{${ignite.storage.dataRegion.region_uat.maxSize}}'/> <property name="persistenceEnabled" value="true"/> </bean> <bean class="org.apache.ignite.configuration.DataRegionConfiguration"> <property name="name" value="r5g"/> <property name="initialSize" value='#{${ignite.storage.dataRegion.region_sc.initialSize}}'/> <property name="maxSize" value='#{${ignite.storage.dataRegion.region_sc.maxSize}}'/> <property name="persistenceEnabled" value="true"/> </bean> </list> </property> <property name="defaultDataRegionConfiguration"> <bean class="org.apache.ignite.configuration.DataRegionConfiguration"> <property name="name" value="Default_Region"/> <property name="maxSize" value="#{40L * 1024 * 1024}"/> <property name="persistenceEnabled" value="true"/> </bean> </property> </bean> </property> </bean> </beans> -- Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/ |
In reply to this post by Mmuzaf
<http://apache-ignite-developers.2346864.n4.nabble.com/file/t85/screenshot.png>
please see the screenshot, I have three data region definition. the default region persistence setting is false, the other two are true. -- Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/ |
In reply to this post by Mmuzaf
Hello!
What is the Ignite version used there? I remember seeing errors like this one, but way back. Regards, -- Ilya Kasnacheev вс, 23 сент. 2018 г. в 21:07, kcheng.mvp <[hidden email]>: > I ran into this error with below configuration(IgniteSpringBean) > > I set * defaultDataRegionConfiguration* as * <property > name="persistenceEnabled" value="false"/>* for unit test. If I set this to > true then everything goes well. > > > <property name="dataStorageConfiguration"> > <bean > class="org.apache.ignite.configuration.DataStorageConfiguration"> > > <property name="storagePath" > value="${ignite.storage.storagePath}"/> > <property name="walPath" > value="${ignite.storage.walPath}"/> > <property name="walArchivePath" > value="${ignite.storage.walArchivePath}"/> > > <property name="dataRegionConfigurations"> > <list> > <bean > class="org.apache.ignite.configuration.DataRegionConfiguration"> > <property name="name" value="r20g"/> > <property name="initialSize" > value='#{${ignite.storage.dataRegion.region_uat.initialSize}}'/> > <property name="maxSize" > value='#{${ignite.storage.dataRegion.region_uat.maxSize}}'/> > * <property name="persistenceEnabled" > value="true"/>* > </bean> > <bean > class="org.apache.ignite.configuration.DataRegionConfiguration"> > <property name="name" value="r5g"/> > <property name="initialSize" > value='#{${ignite.storage.dataRegion.region_sc.initialSize}}'/> > <property name="maxSize" > value='#{${ignite.storage.dataRegion.region_sc.maxSize}}'/> > * <property name="persistenceEnabled" > value="true"/>* > </bean> > </list> > </property> > <property name="defaultDataRegionConfiguration"> > <bean > class="org.apache.ignite.configuration.DataRegionConfiguration"> > <property name="name" value="Default_Region"/> > > <property name="maxSize" value="#{40L * 1024 * > 1024}"/> > * <property name="persistenceEnabled" > value="false"/>* > </bean> > </property> > </bean> > </property> > > > > > here is the full error stack > > > Caused by: class org.apache.ignite.IgniteException: Failed to activate > cluster > at > > org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:990) > at > > org.apache.ignite.internal.cluster.IgniteClusterImpl.active(IgniteClusterImpl.java:315) > at > org.apache.ignite.internal.IgniteKernal.active(IgniteKernal.java:3399) > at > org.apache.ignite.IgniteSpringBean.active(IgniteSpringBean.java:615) > at > com.nfhd.data.Application.lambda$commandLineRunner$0(Application.java:90) > at > > org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:797) > ... 30 more > Caused by: class org.apache.ignite.IgniteCheckedException: Failed to > activate cluster > Suppressed: java.lang.ClassCastException: > org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl cannot be > cast > to > > org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryEx > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.getPageMemoryForCacheGroup(GridCacheDatabaseSharedManager.java:2154) > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreMemory(GridCacheDatabaseSharedManager.java:2007) > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreMemory(GridCacheDatabaseSharedManager.java:1929) > at > > org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.readCheckpointAndRestoreMemory(GridCacheDatabaseSharedManager.java:755) > at > > org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onClusterStateChangeRequest(GridDhtPartitionsExchangeFuture.java:894) > at > > org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:641) > at > > org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:2419) > at > > org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2299) > at > org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) > at java.lang.Thread.run(Thread.java:748) > > > > > -- > Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/ > |
Free forum by Nabble | Edit this page |