Hi there,
When I start Ignite client side code, I met the following error:
[17:13:37,062][SEVERE][exchange-worker-#38%default%][GridCachePartitionExchangeManager]
 Failed to wait for completion of partition map exchange (preloading will not 
start): GridDhtPartitionsExchangeFuture [dummy=false, forcePreload=false, 
reassign=false, discoEvt=DiscoveryCustomEvent 
[customMsg=DynamicCacheChangeBatch [reqs=[DynamicCacheChangeRequest 
[deploymentId=f8887010651-a952654b-c910-4516-b293-c2de7c1d5a4a, 
startCfg=CacheConfiguration [name=UniquefieldsCache, 
storeConcurrentLoadAllThreshold=5, rebalancePoolSize=2, rebalanceTimeout=10000, 
evictPlc=null, evictSync=false, evictKeyBufSize=1024, 
evictSyncConcurrencyLvl=4, evictSyncTimeout=10000, evictFilter=null, 
evictMaxOverflowRatio=10.0, eagerTtl=true, dfltLockTimeout=0, 
startSize=1500000, nearCfg=null, writeSync=PRIMARY_SYNC, 
storeFactory=CacheJdbcPojoStoreFactory [batchSizw=512, dataSrcBean=dataSource, 
dialect=o.a.i.cache.store.jdbc.dialect.OracleDialect@c1fe7e, maxPoolSize=12, 
maxWriteAttempts=2, parallelLoadCacheMinThreshold=512, 
hasher=o.a.i.cache.store.jdbc.JdbcTypeDefaultHasher@d8f790, dataSrc=null], 
storeKeepBinary=false, loadPrevVal=false, 
aff=o.a.i.cache.affinity.rendezvous.RendezvousAffinityFunction@d5ca86, 
cacheMode=PARTITIONED, atomicityMode=ATOMIC, atomicWriteOrderMode=PRIMARY, 
backups=0, invalidate=false, tmLookupClsName=null, rebalanceMode=ASYNC, 
rebalanceOrder=0, rebalanceBatchSize=524288, rebalanceBatchesPrefetchCount=2, 
offHeapMaxMem=-1, swapEnabled=false, maxConcurrentAsyncOps=500, 
writeBehindEnabled=false, writeBehindFlushSize=10240, 
writeBehindFlushFreq=5000, writeBehindFlushThreadCnt=1, 
writeBehindBatchSize=512, memMode=ONHEAP_TIERED, 
affMapper=o.a.i.i.processors.cache.CacheDefaultBinaryAffinityKeyMapper@1f240b8, 
rebalanceDelay=0, rebalanceThrottle=0, interceptor=null, 
longQryWarnTimeout=3000, readFromBackup=true, 
nodeFilter=o.a.i.configuration.CacheConfiguration$IgniteAllNodesPredicate@d57bb6,
 sqlSchema=null, sqlEscapeAll=false, sqlOnheapRowCacheSize=10240, 
snapshotableIdx=false, cpOnRead=true, topValidator=null], cacheType=USER, 
initiatingNodeId=d54726b7-7f79-4124-a021-0cdaf15e57ec, nearCacheCfg=null, 
clientStartOnly=true, stop=false, close=false, failIfExists=false, 
template=false, exchangeNeeded=true, cacheFutTopVer=null, 
cacheName=UniquefieldsCache]], clientNodes=null, 
id=7b18e620651-bda369c9-4b44-40c8-80b2-36e40bf889d2, clientReconnect=false], 
affTopVer=AffinityTopologyVersion [topVer=36, minorTopVer=1], 
super=DiscoveryEvent [evtNode=TcpDiscoveryNode 
[id=d54726b7-7f79-4124-a021-0cdaf15e57ec, addrs=[0:0:0:0:0:0:0:1, 
10.135.66.169, 127.0.0.1], 
sockAddrs=[NKGY2Z002066461.china.huawei.com/10.135.66.169:0, 
/0:0:0:0:0:0:0:1:0, /10.135.66.169:0, /127.0.0.1:0], discPort=0, order=36, 
intOrder=0, lastExchangeTime=1468919612929, loc=true, 
ver=1.5.0#20151229-sha1:f1f8cda2, isClient=true], topVer=36, nodeId8=d54726b7, 
msg=null, type=DISCOVERY_CUSTOM_EVT, tstamp=1468919617026]], 
rcvdIds=GridConcurrentHashSet [elements=[]], rmtIds=null, 
exchId=GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=36, 
minorTopVer=1], nodeId=d54726b7, evt=DISCOVERY_CUSTOM_EVT], init=true, 
ready=false, replied=false, added=true, initFut=GridFutureAdapter [resFlag=2, 
res=false, startTime=1468919617026, endTime=1468919617041, 
ignoreInterrupts=false, lsnr=null, state=DONE], topSnapshot=null, lastVer=null, 
partReleaseFut=null, skipPreload=false, clientOnlyExchange=false, 
initTs=1468919617026, oldest=c29edcbc-85b3-4a70-8b61-98a9283d72a9, 
oldestOrder=1, evtLatch=0, remaining=[], super=GridFutureAdapter [resFlag=1, 
res=class o.a.i.IgniteException: Spring application context resource is not 
injected., startTime=1468919617026, endTime=1468919617041, 
ignoreInterrupts=false, lsnr=null, state=DONE]]
class org.apache.ignite.IgniteCheckedException: Spring application context 
resource is not injected.
         at 
org.apache.ignite.internal.util.IgniteUtils.cast(IgniteUtils.java:7005)
         at 
org.apache.ignite.internal.util.future.GridFutureAdapter.get0(GridFutureAdapter.java:166)
         at 
org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:115)
         at 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1299)
         at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
         at java.lang.Thread.run(Thread.java:745)
Caused by: class org.apache.ignite.IgniteException: Spring application context 
resource is not injected.
         at 
org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:156)
         at 
org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:96)
         at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCache(GridCacheProcessor.java:1243)
         at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1638)
         at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCachesStart(GridCacheProcessor.java:1563)
         at 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.startCaches(GridDhtPartitionsExchangeFuture.java:956)
         at 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:523)
         at 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1297)
         ... 2 more

When I checked the code inside the ignite(CacheJdbcPojoStoreFactory.java), I am 
confused with the following code:
  if (dataSrc != null)
            store.setDataSource(dataSrc);
        else {
            if (dataSrcBean != null) {
                if (appCtx == null)
                    throw new IgniteException("Spring application context 
resource is not injected.");

                IgniteSpringHelper spring;

                try {
                    spring = IgniteComponentType.SPRING.create(false);

                    DataSource data = spring.loadBeanFromAppContext(appCtx, 
dataSrcBean);

                    store.setDataSource(data);
                }
                catch (Exception e) {
                    throw new IgniteException("Failed to load bean in 
application context [beanName=" + dataSrcBean +
                        ", igniteConfig=" + appCtx + ']', e);
                }
            }
        }

I did not see anywhere the appCtx is initialized.
In my xml config file I have defined datasource bean as follows:
<!-- Sample data source -->
         <bean id= "dataSource" class="oracle.jdbc.pool.OracleDataSource">
         <property name="URL" 
value="jdbc:oracle:thin:@xxx.xxx.xxx.xx:1521:xxx"/>
         <property name="user" value="xxxx"/>
         <property name="password" value="xxxxxx"/>
         </bean>


and used in jdbcpojostorefactory declaration:
<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
         <property name="dataSourceBean" value="dataSource"/>
<property name="dialect">
                   <bean 
class="org.apache.ignite.cache.store.jdbc.dialect.OracleDialect"/>
         </property>
         <property name="types">
                   <list>
                            <bean 
class="org.apache.ignite.cache.store.jdbc.JdbcType">
                   …..

Any help?


Best regards,
Kevin

Reply via email to