ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murthy Kakarlamudi <ksa...@gmail.com>
Subject Re: Error running nodes in .net and c++
Date Wed, 27 Apr 2016 02:05:42 GMT
Hi Vladimir...With the above change, I am running into the following error:

22:03:24,474][ERROR][exchange-worker-#49%null%][GridDhtPartitionsExchangeFuture]
Failed to reinitialize local partitions (preloading will be stopped):
GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=1,
minorTopVer=1], nodeId=771a1f0a, evt=DISCOVERY_CUSTOM_EVT]
class org.apache.ignite.IgniteCheckedException: Failed to start component:
class org.apache.ignite.IgniteException: Failed to initialize cache store
(data source is not provided).
at
org.apache.ignite.internal.util.IgniteUtils.startLifecycleAware(IgniteUtils.java:8385)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCache(GridCacheProcessor.java:1269)
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)
at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at java.lang.Thread.run(Unknown Source)
Caused by: class org.apache.ignite.IgniteException: Failed to initialize
cache store (data source is not provided).
at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.start(CacheAbstractJdbcStore.java:297)
at
org.apache.ignite.internal.util.IgniteUtils.startLifecycleAware(IgniteUtils.java:8381)
... 8 more
[22:03:24,513][ERROR][exchange-worker-#49%null%][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=0eab4755451-5d255cd8-68f9-43a8-833c-c0ad665177ae,
startCfg=CacheConfiguration [name=buCache,
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=null,
dialect=null, maxPoolSize=4, maxWriteAttempts=2,
parallelLoadCacheMinThreshold=512,
hasher=o.a.i.cache.store.jdbc.JdbcTypeDefaultHasher@70925b45,
dataSrc=null], storeKeepBinary=false, loadPrevVal=false,
aff=o.a.i.cache.affinity.rendezvous.RendezvousAffinityFunction@1b5bc39d,
cacheMode=PARTITIONED, atomicityMode=ATOMIC, atomicWriteOrderMode=PRIMARY,
backups=1, 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@1494b84d,
rebalanceDelay=0, rebalanceThrottle=0, interceptor=null,
longQryWarnTimeout=3000, readFromBackup=true,
nodeFilter=o.a.i.configuration.CacheConfiguration$IgniteAllNodesPredicate@1df98368,
sqlSchema=null, sqlEscapeAll=false, sqlOnheapRowCacheSize=10240,
snapshotableIdx=false, cpOnRead=true, topValidator=null], cacheType=USER,
initiatingNodeId=771a1f0a-df78-4872-9914-0e99a56ff562, nearCacheCfg=null,
clientStartOnly=false, stop=false, close=false, failIfExists=false,
template=false, exchangeNeeded=true, cacheFutTopVer=null,
cacheName=buCache]], clientNodes=null,
id=1eab4755451-5d255cd8-68f9-43a8-833c-c0ad665177ae,
clientReconnect=false], affTopVer=AffinityTopologyVersion [topVer=1,
minorTopVer=1], super=DiscoveryEvent [evtNode=TcpDiscoveryNode
[id=771a1f0a-df78-4872-9914-0e99a56ff562, addrs=[0:0:0:0:0:0:0:1,
127.0.0.1, 192.168.0.5, 2001:0:9d38:6ab8:203a:34b1:3f57:fffa,
2600:8806:0:8d00:0:0:0:1, 2600:8806:0:8d00:3ccf:1e94:1ab4:83a9,
2600:8806:0:8d00:58be:4acc:9730:7a66], sockAddrs=[LAPTOP-QIT4AVOG/
192.168.0.5:47500, /0:0:0:0:0:0:0:1:47500, LAPTOP-QIT4AVOG/192.168.0.5:47500,
/127.0.0.1:47500, LAPTOP-QIT4AVOG/192.168.0.5:47500, /192.168.0.5:47500,
LAPTOP-QIT4AVOG/192.168.0.5:47500,
/2001:0:9d38:6ab8:203a:34b1:3f57:fffa:47500, LAPTOP-QIT4AVOG/
192.168.0.5:47500, /2600:8806:0:8d00:0:0:0:1:47500,
/2600:8806:0:8d00:3ccf:1e94:1ab4:83a9:47500,
/2600:8806:0:8d00:58be:4acc:9730:7a66:47500], discPort=47500, order=1,
intOrder=1, lastExchangeTime=1461722594448, loc=true,
ver=1.5.0#20151229-sha1:f1f8cda2, isClient=false], topVer=1,
nodeId8=771a1f0a, msg=null, type=DISCOVERY_CUSTOM_EVT,
tstamp=1461722604468]], rcvdIds=GridConcurrentHashSet [elements=[]],
rmtIds=null, exchId=GridDhtPartitionExchangeId
[topVer=AffinityTopologyVersion [topVer=1, minorTopVer=1], nodeId=771a1f0a,
evt=DISCOVERY_CUSTOM_EVT], init=true, ready=false, replied=false,
added=true, initFut=GridFutureAdapter [resFlag=2, res=false,
startTime=1461722604468, endTime=1461722604478, ignoreInterrupts=false,
lsnr=null, state=DONE], topSnapshot=null, lastVer=null,
partReleaseFut=null, skipPreload=false, clientOnlyExchange=false,
initTs=1461722604468, oldest=771a1f0a-df78-4872-9914-0e99a56ff562,
oldestOrder=1, evtLatch=0, remaining=[], super=GridFutureAdapter
[resFlag=1, res=class o.a.i.IgniteCheckedException: Failed to start
component: class o.a.i.IgniteException: Failed to initialize cache store
(data source is not provided)., startTime=1461722604468,
endTime=1461722604478, ignoreInterrupts=false, lsnr=null, state=DONE]]
class org.apache.ignite.IgniteCheckedException: Failed to start component:
class org.apache.ignite.IgniteException: Failed to initialize cache store
(data source is not provided).
at
org.apache.ignite.internal.util.IgniteUtils.startLifecycleAware(IgniteUtils.java:8385)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCache(GridCacheProcessor.java:1269)
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)
at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at java.lang.Thread.run(Unknown Source)
Caused by: class org.apache.ignite.IgniteException: Failed to initialize
cache store (data source is not provided).
at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.start(CacheAbstractJdbcStore.java:297)
at
org.apache.ignite.internal.util.IgniteUtils.startLifecycleAware(IgniteUtils.java:8381)

My spring config:
<?xml version="1.0" encoding="UTF-8"?>

<!-- Licensed to the Apache Software Foundation (ASF) under one or more
contributor
license agreements. See the NOTICE file distributed with this work for
additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->

<!-- Ignite Spring configuration file to startup Ignite cache. This file
demonstrates how to configure cache using Spring. Provided cache will be
created on node startup. Use this configuration file when running HTTP REST
examples (see 'examples/rest' folder). When starting a standalone node, you
need to execute the following command: {IGNITE_HOME}/bin/ignite.{bat|sh}
examples/config/example-cache.xml When starting Ignite from Java IDE, pass
path to this file to Ignition:
Ignition.start("examples/config/example-cache.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-2.5.xsd">

<bean id="myDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="url"
value="jdbc:sqlserver://localhost\MSSQLSERVER64;databaseName=PrimeOne;integratedSecurity=true"
/>
</bean>

<bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="binaryConfiguration">
<bean class="org.apache.ignite.configuration.BinaryConfiguration">
<property name="compactFooter" value="false" />
</bean>
</property>

<property name="cacheConfiguration">
<list>
<!-- Partitioned cache example configuration (Atomic mode). -->
<bean class="org.apache.ignite.configuration.CacheConfiguration">

<property name="atomicityMode" value="ATOMIC" />
<property name="backups" value="1" />
<property name="readThrough" value="true" />
<property name="writeThrough" value="true" />
<property name="cacheStoreFactory">
<bean
class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
<!--  <property name="dataSourceBean" value="myDataSource" />  -->
<property name="dataSource" ref="myDataSource" />
<property name="types">
<list>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcType">
<property name="cacheName" value="buCache" />
<property name="databaseTable" value="BusinessUnit" />
<property name="keyType" value="java.lang.Integer" />
<property name="keyFields">
<list>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
<property name="databaseFieldType">
<util:constant static-field="java.sql.Types.BIGINT" />
</property>
<property name="databaseFieldName" value="BUID" />
<property name="javaFieldType" value="java.lang.Integer" />
<property name="javaFieldName" value="buid" />
</bean>
</list>
</property>
<property name="valueType" value="models.BusinessUnit" />
<property name="valueFields">
<list>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
<property name="databaseFieldType">
<util:constant static-field="java.sql.Types.BIGINT" />
</property>
<property name="databaseFieldName" value="BUID" />
<property name="javaFieldType" value="java.lang.Integer" />
<property name="javaFieldName" value="buid" />
</bean>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
<property name="databaseFieldType">
<util:constant static-field="java.sql.Types.VARCHAR" />
</property>
<property name="databaseFieldName" value="BUName" />
<property name="javaFieldType" value="java.lang.String" />
<property name="javaFieldName" value="buName" />
</bean>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
<property name="databaseFieldType">
<util:constant static-field="java.sql.Types.BIGINT" />
</property>
<property name="databaseFieldName" value="CreatedByID" />
<property name="javaFieldType" value="java.lang.Integer" />
<property name="javaFieldName" value="createdByID" />
</bean>
</list>
</property>
</bean>
</list>
</property>
</bean>
</property>
</bean>
</list>
</property>

<!-- Explicitly configure TCP discovery SPI to provide list of initial
nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<!-- Ignite provides several options for automatic discovery that can
be used instead os static IP based discovery. For information on all
options
refer to our documentation:
http://apacheignite.readme.io/docs/cluster-config -->
<!-- Uncomment static IP finder to enable static-based discovery of
initial nodes. -->
<bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<!-- <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-->
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<value>127.0.0.1:47500..47509</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</beans>


On Tue, Apr 26, 2016 at 8:06 AM, Vladimir Ozerov <vozerov@gridgain.com>
wrote:

> Hi Murthy,
>
> Seems that you faced a kind of usability issue, which happens only in some
> specific cases. Please try replacing the following line in your config:
>
> <property name="dataSourceBean" value="myDataSource" />
>
> with this:
>
> <property name="dataSource" ref="myDataSource" />
>
> It should help.
>
> Vladimir.
>
> On Tue, Apr 26, 2016 at 1:36 AM, Murthy Kakarlamudi <ksatya@gmail.com>
> wrote:
>
>> Hi Alexey...Apologize the delay in my response. Below are the 2 links
>> from gdrive for my Java and c++ projects.
>>
>> Java Project:
>> https://drive.google.com/open?id=0B8lM91-_3MwRZmF6N0tnN1pyN2M
>>
>> C++ Project:
>> https://drive.google.com/open?id=0B8lM91-_3MwRMGE5akVWVXc0RXc
>>
>> Please let me know if you have any difficulty downloading the projects.
>>
>> Thanks,
>> Satya.
>>
>> On Mon, Apr 25, 2016 at 10:49 AM, Alexey Kuznetsov <
>> akuznetsov@gridgain.com> wrote:
>>
>>> I see in stack trace "Caused by: class org.apache.ignite.IgniteException:
>>> Spring application context resource is not injected."
>>>
>>> Also CacheJdbcPojoStoreFactory contains such declaration:
>>> @SpringApplicationContextResource
>>> private transient Object appCtx;
>>>
>>> Anybody know why appCtx may not be injected?
>>>
>>> Also Satya, it is possible for you to prepare small reproducible
>>> example that we could debug?
>>>
>>>
>>> On Mon, Apr 25, 2016 at 9:39 PM, Vladimir Ozerov <vozerov@gridgain.com>
>>> wrote:
>>>
>>>> Alexey Kuznetsov,
>>>>
>>>> Provided you have more expertise with POJO store, could you please
>>>> advise what could cause this exception? Seems that POJO store expects some
>>>> injection, which doesn't happen.
>>>> Are there any specific requirements here? C++ node starts as a regular
>>>> node and also use Spring.
>>>>
>>>> Vladimir.
>>>>
>>>> On Mon, Apr 25, 2016 at 5:32 PM, Murthy Kakarlamudi <ksatya@gmail.com>
>>>> wrote:
>>>>
>>>>> Any help on this issue please...
>>>>>
>>>>> On Sat, Apr 16, 2016 at 7:29 PM, Murthy Kakarlamudi <ksatya@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>    In my use case, I am starting a node from .net which loads data
>>>>>> from SQL Server table into cache upon start up. I have to read those
>>>>>> entries from cache from a c++ node that acts as a client. I am getting
the
>>>>>> below error trying to start the node from c++.
>>>>>>
>>>>>> [19:08:57] Security status [authentication=off, tls/ssl=off]
>>>>>> [19:08:58,163][SEVERE][main][IgniteKernal] Failed to start manager:
>>>>>> GridManagerAdapter [enabled=true,
>>>>>> name=o.a.i.i.managers.discovery.GridDiscoveryManager]
>>>>>> class org.apache.ignite.IgniteCheckedException: Remote node has peer
>>>>>> class loading enabled flag different from local [locId8=f02445af,
>>>>>> locPeerClassLoading=true, rmtId8=8e52f9c9, rmtPeerClassLoading=false,
>>>>>> rmtAddrs=[LAPTOP-QIT4AVOG/0:0:0:0:0:0:0:1, LAPTOP-QIT4AVOG/127.0.0.1,
>>>>>> LAPTOP-QIT4AVOG/192.168.0.5,
>>>>>> LAPTOP-QIT4AVOG/2001:0:9d38:90d7:145b:5bf:bb9b:11d9,
>>>>>> LAPTOP-QIT4AVOG/2600:8806:0:8d00:0:0:0:1,
>>>>>> /2600:8806:0:8d00:3ccf:1e94:1ab4:83a9,
>>>>>> /2600:8806:0:8d00:f114:bf30:2068:352d]]
>>>>>>         at
>>>>>> org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.checkAttributes(GridDiscoveryManager.java:1027)
>>>>>>         at
>>>>>> org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:680)
>>>>>>         at
>>>>>> org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1505)
>>>>>>         at
>>>>>> org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:917)
>>>>>>         at
>>>>>> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1688)
>>>>>>         at
>>>>>> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1547)
>>>>>>         at
>>>>>> org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1003)
>>>>>>         at
>>>>>> org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:534)
>>>>>>         at
>>>>>> org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:515)
>>>>>>         at org.apache.ignite.Ignition.start(Ignition.java:322)
>>>>>>         at
>>>>>> org.apache.ignite.internal.processors.platform.PlatformAbstractBootstrap.start(PlatformAbstractBootstrap.java
>>>>>>
>>>>>> Below if my config for .net node:
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>
>>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>        xsi:schemaLocation="
>>>>>>         http://www.springframework.org/schema/beans
>>>>>>         http://www.springframework.org/schema/beans/spring-beans.xsd
>>>>>> ">
>>>>>>   <bean id="ignite.cfg"
>>>>>> class="org.apache.ignite.configuration.IgniteConfiguration">
>>>>>>     <property name="connectorConfiguration">
>>>>>>       <bean
>>>>>> class="org.apache.ignite.configuration.ConnectorConfiguration">
>>>>>>         <property name="idleTimeout" value="20000"/>
>>>>>>       </bean>
>>>>>>     </property>
>>>>>>
>>>>>>     <property name="cacheConfiguration">
>>>>>>       <list>
>>>>>>         <bean
>>>>>> class="org.apache.ignite.configuration.CacheConfiguration">
>>>>>>           <property name="name" value="BU"/>
>>>>>>           <property name="writeThrough" value="true"/>
>>>>>>           <property name="readThrough" value="true"/>
>>>>>>           <property name="writeBehindEnabled" value="true"/>
>>>>>>           <property name="writeBehindFlushFrequency" value="120000"/>
>>>>>>           <property name="cacheStoreFactory">
>>>>>>             <bean
>>>>>> class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>>>>>>               <property name="typeName"
>>>>>> value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
>>>>>>             </bean>
>>>>>>           </property>
>>>>>>           <property name ="typeMetadata">
>>>>>>             <list>
>>>>>>               <bean class="org.apache.ignite.cache.CacheTypeMetadata">
>>>>>>                 <!-- Type to query. -->
>>>>>>                 <property name="valueType" value="BusinessUnit"/>
>>>>>>                 <!-- Fields to be queried. -->
>>>>>>                 <property name="queryFields">
>>>>>>                   <map>
>>>>>>                     <entry key="BUID" value="java.lang.Integer"/>
>>>>>>                     <entry key="BUName" value="java.lang.String"/>
>>>>>>                     <entry key="CreatedByID"
>>>>>> value="java.lang.Integer"/>
>>>>>>                     <entry key="CreatedDate" value="java.util.Date"/>
>>>>>>                     <entry key="ModifiedByID"
>>>>>> value="java.lang.Integer"/>
>>>>>>                     <entry key="ModifiedDate" value="java.util.Date"/>
>>>>>>                   </map>
>>>>>>                 </property>
>>>>>>                 <!-- Fields to index in ascending order. -->
>>>>>>                 <property name="ascendingFields">
>>>>>>                   <map>
>>>>>>                     <entry key="BUID" value="java.lang.Integer"/>
>>>>>>                   </map>
>>>>>>                 </property>
>>>>>>               </bean>
>>>>>>             </list>
>>>>>>           </property>
>>>>>>         </bean>
>>>>>>       </list>
>>>>>>     </property>
>>>>>>
>>>>>>     <property name="communicationSpi">
>>>>>>       <bean
>>>>>> class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
>>>>>>         <property name="sharedMemoryPort" value="-1"/>
>>>>>>       </bean>
>>>>>>     </property>
>>>>>>
>>>>>>     <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">
>>>>>>               <list>
>>>>>>                 <value>127.0.0.1:47500..47509</value>
>>>>>>               </list>
>>>>>>             </property>
>>>>>>           </bean>
>>>>>>         </property>
>>>>>>       </bean>
>>>>>>     </property>
>>>>>>   </bean>
>>>>>> </beans>
>>>>>>
>>>>>>
>>>>>> Below is my config for node from c++:
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>
>>>>>> <!--
>>>>>>   Licensed to the Apache Software Foundation (ASF) under one or more
>>>>>>   contributor license agreements.  See the NOTICE file distributed
>>>>>> with
>>>>>>   this work for additional information regarding copyright ownership.
>>>>>>   The ASF licenses this file to You under the Apache License, Version
>>>>>> 2.0
>>>>>>   (the "License"); you may not use this file except in compliance
with
>>>>>>   the License.  You may obtain a copy of the License at
>>>>>>
>>>>>>        http://www.apache.org/licenses/LICENSE-2.0
>>>>>>
>>>>>>   Unless required by applicable law or agreed to in writing, software
>>>>>>   distributed under the License is distributed on an "AS IS" BASIS,
>>>>>>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>>>>> implied.
>>>>>>   See the License for the specific language governing permissions
and
>>>>>>   limitations under the License.
>>>>>> -->
>>>>>>
>>>>>> <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="grid.cfg"
>>>>>> class="org.apache.ignite.configuration.IgniteConfiguration">
>>>>>>         <!-- Set to true to enable distributed class loading for
>>>>>> examples, default is false. -->
>>>>>>         <property name="peerClassLoadingEnabled" value="true"/>
>>>>>>
>>>>>>         <property name="cacheConfiguration">
>>>>>>             <list>
>>>>>>                 <!--
>>>>>>                     Partitioned cache example configuration with
>>>>>> binary objects enabled.
>>>>>>                     Used in .NET example that is available only in
>>>>>> enterprise edition.
>>>>>>                 -->
>>>>>>                 <bean
>>>>>> class="org.apache.ignite.configuration.CacheConfiguration">
>>>>>> <property name="atomicityMode" value="ATOMIC"/>
>>>>>>                     <property name="backups" value="1"/>
>>>>>>                 </bean>
>>>>>>
>>>>>>                 <!--
>>>>>>                     Partitioned cache example configuration.
>>>>>>                     Used in .NET cache store example that is
>>>>>> available only in enterprise edition.
>>>>>>                 -->
>>>>>>                 <bean
>>>>>> class="org.apache.ignite.configuration.CacheConfiguration">
>>>>>>                     <property name="name" value="tx"/>
>>>>>>                     <property name="atomicityMode"
>>>>>> value="TRANSACTIONAL"/>
>>>>>>                     <property name="backups" value="1"/>
>>>>>>                 </bean>
>>>>>>             </list>
>>>>>>         </property>
>>>>>>
>>>>>>         <!-- Explicitly configure TCP discovery SPI to provide
list
>>>>>> of initial nodes. -->
>>>>>>         <property name="discoverySpi">
>>>>>>             <bean
>>>>>> class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
>>>>>>                 <property name="ipFinder">
>>>>>>                     <!--
>>>>>>                         Ignite provides several options for automatic
>>>>>> discovery that can be used
>>>>>>                         instead os static IP based discovery.
>>>>>>                     -->
>>>>>>                     <!-- Uncomment static IP finder to enable
>>>>>> static-based discovery of initial nodes. -->
>>>>>>                     <bean
>>>>>> class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
>>>>>>                     <!-- <bean
>>>>>> class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
>>>>>> -->
>>>>>>                         <property name="addresses">
>>>>>>                             <list>
>>>>>>                                 <!-- In distributed environment,
>>>>>> replace with actual host IP address. -->
>>>>>>                                 <value>127.0.0.1:47500..47501</value>
>>>>>>                             </list>
>>>>>>                         </property>
>>>>>>                     </bean>
>>>>>>                 </property>
>>>>>>             </bean>
>>>>>>         </property>
>>>>>>     </bean>
>>>>>> </beans>
>>>>>>
>>>>>> Below c++ code is trying to access the cache:
>>>>>> int main()
>>>>>> {
>>>>>> IgniteConfiguration cfg;
>>>>>>
>>>>>> cfg.jvmInitMem = 512;
>>>>>> cfg.jvmMaxMem = 512;
>>>>>>
>>>>>> //cfg.springCfgPath =
>>>>>> "platforms/cpp/examples/config/example-cache.xml";
>>>>>> cfg.springCfgPath = "config/example-cache.xml";
>>>>>> try
>>>>>> {
>>>>>> // Start a node.
>>>>>> Ignite grid = Ignition::Start(cfg);
>>>>>> std::cout << std::endl;
>>>>>> std::cout << ">>> Cache node started." << std::endl;
>>>>>> std::cout << std::endl;
>>>>>>
>>>>>> //string key
>>>>>> Cache<std::string, CBusinessObject> cache =
>>>>>> grid.GetCache<std::string, CBusinessObject>("BU");
>>>>>> cache.Clear();
>>>>>> CBusinessObject obj("MSFT", 45.23);
>>>>>> //save in cache
>>>>>> cache.Put("MSFT", obj);
>>>>>>
>>>>>> //retreive from cache
>>>>>> CBusinessObject result = cache.Get("MSFT");
>>>>>>
>>>>>> std::cout << result.ToString();
>>>>>>
>>>>>> // Stop node.
>>>>>> Ignition::StopAll(false);
>>>>>> }
>>>>>> catch (IgniteError& err)
>>>>>> {
>>>>>> std::cout << "An error occurred: " << err.GetText() <<
std::endl;
>>>>>> }
>>>>>>
>>>>>> std::cout << std::endl;
>>>>>> std::cout << ">>> Execution finished, press any key
to exit ..." <<
>>>>>> std::endl;
>>>>>> std::cout << std::endl;
>>>>>>
>>>>>> std::cin.get();
>>>>>>
>>>>>>     return 0;
>>>>>> }
>>>>>>
>>>>>> Thanks for any help.
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Alexey Kuznetsov
>>> GridGain Systems
>>> www.gridgain.com
>>>
>>
>>
>

Mime
View raw message