[
https://issues.apache.org/jira/browse/IGNITE-4829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexey Kuznetsov reassigned IGNITE-4829:
----------------------------------------
Assignee: Valentin Kulichenko (was: Alexey Kuznetsov)
[~vkulichenko], could you please review my changes in branch ignite-4829.
See diff: https://github.com/apache/ignite/compare/ignite-4829
> Spring context is not injected into POJO store when JDBC driver is utilized
> ---------------------------------------------------------------------------
>
> Key: IGNITE-4829
> URL: https://issues.apache.org/jira/browse/IGNITE-4829
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 1.9
> Reporter: Denis Magda
> Assignee: Valentin Kulichenko
> Priority: Critical
> Fix For: 2.0
>
> Attachments: SampleJdbcApp.zip
>
>
> Faced with the exception reported in the discussion initiated a long time ago:
> http://apache-ignite-users.70518.x6.nabble.com/ignite-Spring-application-context-resource-is-not-injected-problem-td6377.html
> Basically, I get the same exception:
> {code}
> class org.apache.ignite.IgniteException: Spring application context resource
> is not injected.
> at
> org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:171)
> at
> org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.create(CacheJdbcPojoStoreFactory.java:100)
> at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCache(GridCacheProcessor.java:1261)
> at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:791)
> at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:950)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1799)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1602)
> at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:569)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:516)
> at org.apache.ignite.Ignition.start(Ignition.java:322)
> at
> org.apache.ignite.internal.jdbc2.JdbcConnection.getIgnite(JdbcConnection.java:191)
> at
> org.apache.ignite.internal.jdbc2.JdbcConnection.<init>(JdbcConnection.java:152)
> at org.apache.ignite.IgniteJdbcDriver.connect(IgniteJdbcDriver.java:361)
> at java.sql.DriverManager.getConnection(DriverManager.java:664)
> at java.sql.DriverManager.getConnection(DriverManager.java:270)
> at Main.initIgniteConnection(Main.java:260)
> at Main.main(Main.java:29)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
> {code}
> The exception occurs when my application uses Ignite JDBC driver to connect
> to a cluster. The cluster persists data to a relation database (Postrgers),
> so I have the POJO store defined in the application configuration. The latter
> was generated for by Apache Ignite Web Console and the POJO store is set by
> {{CacheJdbcPojoStoreFactory.dataSourceBean}} which causes the error.
> If I set the POJO store using {{CacheJdbcPojoStoreFactory.dataSource}} method
> then the issue disappears.
> To reproduce the issue do the following:
> - Unzip the attached project and start {{ServerNode}} class.
> - Start the sample application that uses Ignite JDBC driver and you'll get
> the reported exception.
> Change the configuration from {{ignite-jdbc-bad}} to {{ignite-jdbc}} and the
> exception dissappears because the latter sets the store using
> {{CacheJdbcPojoStoreFactory.dataSource}}.
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)