Fwd: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2017-03-15 Thread Denis Magda
Cross-posting to the dev list.

I’ve faced the same issue, filed a ticket with a reproducer and suggested a 
workaround:
https://issues.apache.org/jira/browse/IGNITE-4829 
<https://issues.apache.org/jira/browse/IGNITE-4829>

*Alex K.*, could you please take care of the issue? If this is something we 
can’t fix quickly then Apache Ignite Web Console configuration wizard has to 
set the POJO store configuration differently. 

—
Denis

> Begin forwarded message:
> 
> From: san <hv.sanj...@gmail.com>
> Subject: Spring application context resource is not injected exception while 
> starting ignite in jdbc driver mode
> Date: August 24, 2016 at 6:27:47 AM PDT
> To: user@ignite.apache.org
> Reply-To: user@ignite.apache.org
> 
> I am facing an issue while starting ignite in JDBC driver mode. i have my
> cache in remote node and i need to access using plain sql queries. Hence i
> am using ignite jdbc driver. please find the code snippet.  
> 
> Class.forName("org.apache.ignite.IgniteJdbcDriver");
> Connection conn =
> DriverManager.getConnection("jdbc:ignite:cfg://ignite-jdbc.xml");
> ResultSet rs = conn.createStatement().executeQuery("select * from users");
> 
> my xml also simple. since cache is already loaded in remote node.
> 
>   class="org.apache.ignite.configuration.IgniteConfiguration">
> 
>
> 
>
> 
> 
> 
>
> class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
>
> class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
>
>
>127.0.0.1:47500..47549
>
>
>
>
>
>
> 
> please do the needful.. 
> 
> 
> 
> 
> --
> View this message in context: 
> http://apache-ignite-users.70518.x6.nabble.com/Spring-application-context-resource-is-not-injected-exception-while-starting-ignite-in-jdbc-driver-me-tp7272.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.



Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-09-08 Thread vkulichenko
Hi,

How do you start the server node with C#? Please show it's configuration as
well.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Spring-application-context-resource-is-not-injected-exception-while-starting-ignite-in-jdbc-driver-me-tp7272p7619.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-09-06 Thread amitpa
@agura If you setup Java Spring Automatic persistence And try to connect a
Java node with C# this occurs repeatedly.

Is there any work around for this?

Just as note The same config works with C++ and Java but not with Java and
C#?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Spring-application-context-resource-is-not-injected-exception-while-starting-ignite-in-jdbc-driver-me-tp7272p7552.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-29 Thread san
Thanks Sir. thanks for the info.

Regards,
San



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Spring-application-context-resource-is-not-injected-exception-while-starting-ignite-in-jdbc-driver-me-tp7299p7371.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-29 Thread Andrey Gura
Yes, SQL queries are read-only, so DB updates aren't possible.

CRUD operations using SQL are in progress now.

On Mon, Aug 29, 2016 at 10:24 AM, san  wrote:

> Hi,
>
> please let know "SQL Queries" are read-only?  is cache and database update
> possible using SQL Queries?
>
> https://apacheignite.readme.io/v1.7/docs/sql-queries
>
> Regards,
> Sanjeev
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Spring-application-context-resource-
> is-not-injected-exception-while-starting-ignite-in-jdbc-
> driver-me-tp7299p7364.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-29 Thread san
Hi,

please let know "SQL Queries" are read-only?  is cache and database update
possible using SQL Queries?

https://apacheignite.readme.io/v1.7/docs/sql-queries  

Regards,
Sanjeev



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Spring-application-context-resource-is-not-injected-exception-while-starting-ignite-in-jdbc-driver-me-tp7299p7364.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-26 Thread Nikolai Tikhonov
Andery,

It's for guarantee consistency. We should update entries in store in one
transaction how in Ignite.

On Fri, Aug 26, 2016 at 2:01 PM, Andrey Gura  wrote:

> Val,
>
> Why we need store on client node in case of partitioned or replicated
> cache?
>
> On Fri, Aug 26, 2016 at 4:53 AM, vkulichenko <
> valentin.kuliche...@gmail.com> wrote:
>
>> Hi,
>>
>> This happens because JDBC driver tries to initialize the store. This is
>> needed for regular client nodes, but for the driver this doesn't make much
>> sense. I created a ticket: https://issues.apache.org/jira
>> /browse/IGNITE-3771
>>
>> -Val
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/Spring-application-context-resource-is-not-
>> injected-exception-while-starting-ignite-in-jdbc-driver
>> -me-tp7299p7328.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Andrey Gura
> GridGain Systems, Inc.
> www.gridgain.com
>


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-26 Thread Andrey Gura
Val,

Why we need store on client node in case of partitioned or replicated cache?

On Fri, Aug 26, 2016 at 4:53 AM, vkulichenko 
wrote:

> Hi,
>
> This happens because JDBC driver tries to initialize the store. This is
> needed for regular client nodes, but for the driver this doesn't make much
> sense. I created a ticket: https://issues.apache.org/
> jira/browse/IGNITE-3771
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Spring-application-context-resource-
> is-not-injected-exception-while-starting-ignite-in-jdbc-
> driver-me-tp7299p7328.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-26 Thread Vladislav Pyatkov
Hello,

At this moment Ignite support only SELECT* SQL query.

You can use cache API directly for update or insert data. Ignite implements
JCache API for access to data, you can look article about this[1].

[1]: http://apacheignite.gridgain.org/docs/jcache

On Fri, Aug 26, 2016 at 9:32 AM, san  wrote:

> Hi,
>
> please let know, If JDBC driver is read only then what is the advantage we
> are getting.
> our scenario is
> 1. Populate cache using 'Automatic Persistence' in server.
> 2. client will connect to server using JDBC Driver and access the cache
> using standard sql queries.
> 3. And we are expecting if value is not there in server cache, then server
> should fetch from the db (ReadThrough)
> 4. as well as update the cache using standard sql query and server shall
> update the DB (WriteThrough)
>
> Advantage we are expecting from this is, we can access ignite server cache
> using sql query to do CRUD operation. server shall take care of DB reads
> and
> writes.
>
> In this model without change in existing DAO(JDBC code) layer  we can
> introduce ignite cache in-between application and  DB.
>
> please let know how to solve this issue. is  there any way to do it.
>
> Thanks,
> San
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Spring-application-context-resource-
> is-not-injected-exception-while-starting-ignite-in-jdbc-
> driver-me-tp7299p7332.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Vladislav Pyatkov


Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-25 Thread vkulichenko
Hi,

This happens because JDBC driver tries to initialize the store. This is
needed for regular client nodes, but for the driver this doesn't make much
sense. I created a ticket: https://issues.apache.org/jira/browse/IGNITE-3771

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Spring-application-context-resource-is-not-injected-exception-while-starting-ignite-in-jdbc-driver-me-tp7299p7328.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-25 Thread san
Hi,

I am facing an issue while starting ignite in JDBC driver mode. i have my
cache in remote node and i need to access using plain sql queries. Hence i
am using ignite jdbc driver. please find the code snippet.

please find the exception stack trace and complete jdbc driver client xml
file. I used Automatic Persistence, and built cache in server. from my jdbc
client i just need to access the server cache.

Class.forName("org.apache.ignite.IgniteJdbcDriver"); 
Connection conn =
DriverManager.getConnection("jdbc:ignite:cfg://ignite-jdbc.xml"); 
ResultSet rs = conn.createStatement().executeQuery("select * from users"); 

 

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;>












127.0.0.1:47500..47549











exception 

[19:45:54] Topology snapshot [ver=2, servers=1, clients=1, CPUs=4,
heap=3.5GB] 
[19:45:54,992][SEVERE][exchange-worker-#42%ignite-jdbc-driver-7c5edc62-1858-41ac-9a92-2156a28ae201%][GridDhtPartitionsExchangeFuture]
Failed to reinitialize local partitions (preloading will be stopped):
GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=2,
minorTopVer=1], nodeId=1579d3a7, evt=DISCOVERY_CUSTOM_EVT] 
class org.apache.ignite.IgniteException: Spring application context resource
is not injected. 
at
org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:167)
 
at
org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:100)
 
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCache(GridCacheProcessor.java:1259)
 
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1712)
 
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1613)
 
at
org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.onCacheChangeRequest(CacheAffinitySharedManager.java:382)
 
at
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onCacheChangeRequest(GridDhtPartitionsExchangeFuture.java:565)
 
at
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:448)
 
at
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1440)
 
at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) 
at java.lang.Thread.run(Thread.java:745) 
[19:45:54,999][SEVERE][exchange-worker-#42%ignite-jdbc-driver-7c5edc62-1858-41ac-9a92-2156a28ae201%][GridCachePartitionExchangeManager]
Failed to wait for completion of partition map exchange (preloading will not
start): GridDhtPartitionsExchangeFuture [dummy=false, forcePreload=false,
reassign=false, discoEvt=DiscoveryCustomEvent [customMsg=null,
affTopVer=AffinityTopologyVersion [topVer=2, minorTopVer=1],
super=DiscoveryEvent [evtNode=TcpDiscoveryNode
[id=1579d3a7-546f-4646-b85e-f130e8ac9c56, addrs=[127.0.0.1],
sockAddrs=[/127.0.0.1:0], discPort=0, order=2, intOrder=0,
lastExchangeTime=1472048115925, loc=true, ver=1.7.0#20160801-sha1:383273e3,
isClient=true], topVer=2, nodeId8=1579d3a7, msg=null,
type=DISCOVERY_CUSTOM_EVT, tstamp=1472048154971]], crd=TcpDiscoveryNode
[id=60a665b3-576b-4eb3-8675-210f15695477, addrs=[0:0:0:0:0:0:0:1, 10.0.4.42,
10.0.9.245, 10.6.5.9, 127.0.0.1], sockAddrs=[/10.0.9.245:47500,
KOD-LAP-247.inovate.inovate.com/10.6.5.9:47500, /0:0:0:0:0:0:0:1:47500,
/127.0.0.1:47500, /10.0.4.42:47500], discPort=47500, order=1, intOrder=1,
lastExchangeTime=1472048154283, loc=false, ver=1.7.0#20160801-sha1:383273e3,
isClient=false], exchId=GridDhtPartitionExchangeId
[topVer=AffinityTopologyVersion [topVer=2, minorTopVer=1], nodeId=1579d3a7,
evt=DISCOVERY_CUSTOM_EVT], added=true, initFut=GridFutureAdapter [resFlag=2,
res=false, startTime=1472048154971, endTime=1472048154991,
ignoreInterrupts=false, state=DONE], init=false, topSnapshot=null,
lastVer=null, partReleaseFut=null, affChangeMsg=null, skipPreload=true,
clientOnlyExchange=false, initTs=1472048154971, centralizedAff=false,
evtLatch=0, remaining=[60a665b3-576b-4eb3-8675-210f15695477],
srvNodes=[TcpDiscoveryNode [id=60a665b3-576b-4eb3-8675-210f15695477,
addrs=[0:0:0:0:0:0:0:1, 10.0.4.42, 10.0.9.245, 10.6.5.9, 127.0.0.1],
sockAddrs=[/10.0.9.245:47500,

Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-24 Thread san
Hi agura,

please find the exception stack trace and complete jdbc driver client xml
file. I used Automatic Persistence, and built cache in server. from my jdbc
client i just need to access the server cache. for this do we need to add
any additional configuration in jdbc driver configuration file?



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;>












127.0.0.1:47500..47549











exception

[19:45:54] Topology snapshot [ver=2, servers=1, clients=1, CPUs=4,
heap=3.5GB]
[19:45:54,992][SEVERE][exchange-worker-#42%ignite-jdbc-driver-7c5edc62-1858-41ac-9a92-2156a28ae201%][GridDhtPartitionsExchangeFuture]
Failed to reinitialize local partitions (preloading will be stopped):
GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=2,
minorTopVer=1], nodeId=1579d3a7, evt=DISCOVERY_CUSTOM_EVT]
class org.apache.ignite.IgniteException: Spring application context resource
is not injected.
at
org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:167)
at
org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:100)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCache(GridCacheProcessor.java:1259)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1712)
at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1613)
at
org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.onCacheChangeRequest(CacheAffinitySharedManager.java:382)
at
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onCacheChangeRequest(GridDhtPartitionsExchangeFuture.java:565)
at
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:448)
at
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1440)
at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at java.lang.Thread.run(Thread.java:745)
[19:45:54,999][SEVERE][exchange-worker-#42%ignite-jdbc-driver-7c5edc62-1858-41ac-9a92-2156a28ae201%][GridCachePartitionExchangeManager]
Failed to wait for completion of partition map exchange (preloading will not
start): GridDhtPartitionsExchangeFuture [dummy=false, forcePreload=false,
reassign=false, discoEvt=DiscoveryCustomEvent [customMsg=null,
affTopVer=AffinityTopologyVersion [topVer=2, minorTopVer=1],
super=DiscoveryEvent [evtNode=TcpDiscoveryNode
[id=1579d3a7-546f-4646-b85e-f130e8ac9c56, addrs=[127.0.0.1],
sockAddrs=[/127.0.0.1:0], discPort=0, order=2, intOrder=0,
lastExchangeTime=1472048115925, loc=true, ver=1.7.0#20160801-sha1:383273e3,
isClient=true], topVer=2, nodeId8=1579d3a7, msg=null,
type=DISCOVERY_CUSTOM_EVT, tstamp=1472048154971]], crd=TcpDiscoveryNode
[id=60a665b3-576b-4eb3-8675-210f15695477, addrs=[0:0:0:0:0:0:0:1, 10.0.4.42,
10.0.9.245, 10.6.5.9, 127.0.0.1], sockAddrs=[/10.0.9.245:47500,
KOD-LAP-247.inovate.inovate.com/10.6.5.9:47500, /0:0:0:0:0:0:0:1:47500,
/127.0.0.1:47500, /10.0.4.42:47500], discPort=47500, order=1, intOrder=1,
lastExchangeTime=1472048154283, loc=false, ver=1.7.0#20160801-sha1:383273e3,
isClient=false], exchId=GridDhtPartitionExchangeId
[topVer=AffinityTopologyVersion [topVer=2, minorTopVer=1], nodeId=1579d3a7,
evt=DISCOVERY_CUSTOM_EVT], added=true, initFut=GridFutureAdapter [resFlag=2,
res=false, startTime=1472048154971, endTime=1472048154991,
ignoreInterrupts=false, state=DONE], init=false, topSnapshot=null,
lastVer=null, partReleaseFut=null, affChangeMsg=null, skipPreload=true,
clientOnlyExchange=false, initTs=1472048154971, centralizedAff=false,
evtLatch=0, remaining=[60a665b3-576b-4eb3-8675-210f15695477],
srvNodes=[TcpDiscoveryNode [id=60a665b3-576b-4eb3-8675-210f15695477,
addrs=[0:0:0:0:0:0:0:1, 10.0.4.42, 10.0.9.245, 10.6.5.9, 127.0.0.1],
sockAddrs=[/10.0.9.245:47500,
KOD-LAP-247.inovate.inovate.com/10.6.5.9:47500, /0:0:0:0:0:0:0:1:47500,
/127.0.0.1:47500, /10.0.4.42:47500], discPort=47500, order=1, intOrder=1,
lastExchangeTime=1472048154283, loc=false, ver=1.7.0#20160801-sha1:383273e3,
isClient=false]], super=GridFutureAdapter [resFlag=1, res=class
o.a.i.IgniteException: Spring application context resource is not injected.,

Re: Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-24 Thread Andrey Gura
Hi,

could you please provide exception and stack trace? Also please make sure
that your Spring configuration file has  root element.

On Wed, Aug 24, 2016 at 4:27 PM, san  wrote:

> I am facing an issue while starting ignite in JDBC driver mode. i have my
> cache in remote node and i need to access using plain sql queries. Hence i
> am using ignite jdbc driver. please find the code snippet.
>
> Class.forName("org.apache.ignite.IgniteJdbcDriver");
> Connection conn =
> DriverManager.getConnection("jdbc:ignite:cfg://ignite-jdbc.xml");
> ResultSet rs = conn.createStatement().executeQuery("select * from users");
>
> my xml also simple. since cache is already loaded in remote node.
>
>class="org.apache.ignite.configuration.IgniteConfiguration">
>
> 
>
> 
>
>
>
> 
>  class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
> 
>  class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.
> TcpDiscoveryVmIpFinder">
> 
> 
> 127.0.0.1:47500..47549
> 
> 
> 
> 
> 
> 
>
> please do the needful..
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Spring-application-context-resource-
> is-not-injected-exception-while-starting-ignite-in-jdbc-
> driver-me-tp7272.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com


Spring application context resource is not injected exception while starting ignite in jdbc driver mode

2016-08-24 Thread san
I am facing an issue while starting ignite in JDBC driver mode. i have my
cache in remote node and i need to access using plain sql queries. Hence i
am using ignite jdbc driver. please find the code snippet.  

Class.forName("org.apache.ignite.IgniteJdbcDriver");
Connection conn =
DriverManager.getConnection("jdbc:ignite:cfg://ignite-jdbc.xml");
ResultSet rs = conn.createStatement().executeQuery("select * from users");

my xml also simple. since cache is already loaded in remote node.

  





   







127.0.0.1:47500..47549







please do the needful.. 




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Spring-application-context-resource-is-not-injected-exception-while-starting-ignite-in-jdbc-driver-me-tp7272.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.