[14:28:10,334][ERROR][exchange-worker-#29%null%][GridDhtPartitionsExchangeFuture]
Failed to reinitialize local partitions (preloading will be stopped):
GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=1,
minorTopVer=1], nodeId=d8a6d5d6, evt=DISCOVERY_CUSTOM_EVT]
class org.apache.ignite.IgniteException: Either transaction manager or data
source is required by CacheSpringStoreSessionListener.
        at
org.apache.ignite.cache.store.spring.CacheSpringStoreSessionListener.start(CacheSpringStoreSessionListener.java:118)
        at
org.apache.ignite.internal.processors.cache.GridCacheUtils.startStoreSessionListeners(GridCacheUtils.java:1527)
        at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.start0(GridCacheStoreManagerAdapter.java:230)
        at
org.apache.ignite.internal.processors.cache.store.CacheOsStoreManager.start0(CacheOsStoreManager.java:64)
        at
org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter.start(GridCacheManagerAdapter.java:50)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1243)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1943)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1833)
        at
org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.onCacheChangeRequest(CacheAffinitySharedManager.java:379)
        at
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onCacheChangeRequest(GridDhtPartitionsExchangeFuture.java:688)
        at
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:529)
        at
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1806)
        at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
        at java.lang.Thread.run(Thread.java:745)





        @SuppressWarnings({ "unchecked", "serial" })
        public static void main(String[] args) {
                // TODO Auto-generated method stub
                
                   try (Ignite ignite =
Ignition.start("examples/config/example-ignite.xml")) {
                    System.out.println();
                    System.out.println(">>> Cache store example started.");
                    CacheConfiguration<Long, Employee> cacheCfg = new
CacheConfiguration<>(CACHE_NAME);
                    cacheCfg.setAtomicityMode(TRANSACTIONAL);
                    // Configure Spring store.
                    @SuppressWarnings("unused")
                                CacheSpringEmployeeStore store=new 
CacheSpringEmployeeStore();
                   
cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheSpringEmployeeStore.class));
                    cacheCfg.setReadThrough(true);
                    cacheCfg.setWriteThrough(true);
                    // Configure Spring session listener.
                    cacheCfg.setCacheStoreSessionListenerFactories(new
Factory<CacheStoreSessionListener>() {
                        @Override public CacheStoreSessionListener create() {
                            CacheSpringStoreSessionListener lsnr = new
CacheSpringStoreSessionListener();

                           
lsnr.setDataSource(JdbcConnectionPool.create("jdbc:h2:tcp://localhost/mem:ExampleDb",
"sa", ""));
                          

                            return lsnr;
                        }
                    });
                    
                    cacheCfg.setReadThrough(true);
                    cacheCfg.setWriteThrough(true);
                    
                    try (IgniteCache<Long, Employee> cache =
ignite.getOrCreateCache(cacheCfg)) {
                        // Make initial cache loading from persistent store. 
This
is a
                        // distributed operation and will call
CacheStore.loadCache(...)
                        // method on all nodes in topology.
                      //  loadCache(cache);

                        // Start transaction and execute several cache 
operations
with
                        // read/write-through to persistent store.
                        executeTransaction(cache);
                        Employee val = cache.get(id);

                        System.out.println("Read value: " + val.getName());
                    }
                    finally {
                        // Distributed cache could be removed from cluster only 
by
#destroyCache() call.
                        ignite.destroyCache(CACHE_NAME);
                    }
                   }

        }



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/i-am-tring-to-load-mongo-store-but-i-am-getting-this-messege-tp13144.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to