[
https://issues.apache.org/jira/browse/IGNITE-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15046898#comment-15046898
]
Denis Magda edited comment on IGNITE-2108 at 12/8/15 3:13 PM:
--------------------------------------------------------------
The issue disappears if to replace H2DemoStoreFactory implementation with the
following
{noformat}
private static class H2DemoStoreFactory<K, V> extends
CacheJdbcPojoStoreFactory<K, V> {
@Override public CacheJdbcPojoStore<K, V> create() {
setDialect(new H2Dialect());
setDataSource(JdbcConnectionPool.create("jdbc:h2:tcp://localhost/~/schema-import/demo",
"sa", ""));
return super.create();
}
}
{noformat}
It means that a default constructor, that is used in the current
implementation, is not got called during deserialization. The issue is
reproduced on both optimized and binary marshallers.
However it gets called in the previous versions.
was (Author: dmagda):
The issue disappears if to replace H2DemoStoreFactory implementation with the
following
{noformat}
private static class H2DemoStoreFactory<K, V> extends
CacheJdbcPojoStoreFactory<K, V> {
@Override public CacheJdbcPojoStore<K, V> create() {
setDialect(new H2Dialect());
setDataSource(JdbcConnectionPool.create("jdbc:h2:tcp://localhost/~/schema-import/demo",
"sa", ""));
return super.create();
}
}
{noformat}
It means that a default constructor, that is used in the current
implementation, is not got called during deserialization. The issue is
reproduced on both optimized and binary marshallers.
> CacheJdbcPojoStoreFactory is not fully initialized when deserialized on a
> remote node
> -------------------------------------------------------------------------------------
>
> Key: IGNITE-2108
> URL: https://issues.apache.org/jira/browse/IGNITE-2108
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 1.5
> Reporter: Denis Magda
> Priority: Blocker
> Fix For: 1.5
>
>
> When a cache is started dynamically and has an implementation of
> {{CacheJdbcPojoStoreFactory}} in its configuration then the cache startup
> procedure will fail on a remote node with the following exception:
> {noformat}
> [16:14:10,014][ERROR][exchange-worker-#49%null%][GridDhtPartitionsExchangeFuture]
> Failed to reinitialize local partitions (preloading will be stopped):
> GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=2,
> minorTopVer=1], nodeId=a7a1f89a, 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:1251)
> at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1620)
> at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCachesStart(GridCacheProcessor.java:1545)
> at
> org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.startCaches(GridDhtPartitionsExchangeFuture.java:944)
> at
> org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:511)
> 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(Thread.java:745)
> 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
> {noformat}
> The reason is that in version 1.5 {{CacheJdbcPojoStoreFactory}} was reworked
> significantly and presently it has field {{private transient DataSource
> dataSrc}} that must be initiated somehow after deserialization.
> The issue is easily to reproduce with schema-import example:
> 1) complete all the steps described in the demo tutorial
> https://apacheignite.readme.io/docs/automatic-persistence#example
> 2) Start a remote node using {{DemoNode}}
> 3) Start {{Demo}}
> 4) The node started with {{DemoNode}} won't be able to start a cache because
> of the issue with the storage described above
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)