InvalidClassException local class incompatible for custom cache store factory

classic Classic list List threaded Threaded
8 messages Options
relax ken relax ken
Reply | Threaded
Open this post in threaded view
|

InvalidClassException local class incompatible for custom cache store factory

Hi,

I am testing my custom CacheStoreFactory. It worked fine previously on my local dev machine. After I changed this class and run it, I got `java.io.InvalidClassException: xxx.CacheStoreFactory; local class incompatible: stream classdesc serialVersionUID = 7199421607011991053, local class serialVersionUID = -7841220943604923990`

Is it the previous serialized class cached somewhere and incompatible with the new one? I only have this single node. There is no other nodes.

Another question is I try to understand why CacheStoreFactory and CacheStore are serialized to newly joined node. Does it mean if I changed their implementation and release the changes to a new node, the new node will still perform as the old one?

Very appreciate any help.

Thanks,

Ken
Denis Mekhanikov Denis Mekhanikov
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

Ken,

Cache store factory is a part of a cache configuration. So, if a cache configuration is stored somewhere, and it's deserialized using a new class, then this exception is thrown.
It's possible if you have native persistence enabled, for example. The cache configuration is read from disk when a node starts.

Cache configurations are sent to newly joined nodes along with discovery data. If you want to change the cache store implementation, then you should destroy the cache and start it with a new config.
Different implementations of cache store on different nodes is not a correct situation, so you should avoid it.

Denis

вт, 19 мар. 2019 г. в 20:30, relax ken <[hidden email]>:
Hi,

I am testing my custom CacheStoreFactory. It worked fine previously on my local dev machine. After I changed this class and run it, I got `java.io.InvalidClassException: xxx.CacheStoreFactory; local class incompatible: stream classdesc serialVersionUID = 7199421607011991053, local class serialVersionUID = -7841220943604923990`

Is it the previous serialized class cached somewhere and incompatible with the new one? I only have this single node. There is no other nodes.

Another question is I try to understand why CacheStoreFactory and CacheStore are serialized to newly joined node. Does it mean if I changed their implementation and release the changes to a new node, the new node will still perform as the old one?

Very appreciate any help.

Thanks,

Ken
relax ken relax ken
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

Thanks! 

On Wed, Mar 20, 2019 at 8:15 AM Denis Mekhanikov <[hidden email]> wrote:
Ken,

Cache store factory is a part of a cache configuration. So, if a cache configuration is stored somewhere, and it's deserialized using a new class, then this exception is thrown.
It's possible if you have native persistence enabled, for example. The cache configuration is read from disk when a node starts.

Cache configurations are sent to newly joined nodes along with discovery data. If you want to change the cache store implementation, then you should destroy the cache and start it with a new config.
Different implementations of cache store on different nodes is not a correct situation, so you should avoid it.

Denis

вт, 19 мар. 2019 г. в 20:30, relax ken <[hidden email]>:
Hi,

I am testing my custom CacheStoreFactory. It worked fine previously on my local dev machine. After I changed this class and run it, I got `java.io.InvalidClassException: xxx.CacheStoreFactory; local class incompatible: stream classdesc serialVersionUID = 7199421607011991053, local class serialVersionUID = -7841220943604923990`

Is it the previous serialized class cached somewhere and incompatible with the new one? I only have this single node. There is no other nodes.

Another question is I try to understand why CacheStoreFactory and CacheStore are serialized to newly joined node. Does it mean if I changed their implementation and release the changes to a new node, the new node will still perform as the old one?

Very appreciate any help.

Thanks,

Ken
xmw45688 xmw45688
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

In reply to this post by Denis Mekhanikov
Hi Denis,  I have the same issue when persistenceEnabled = true and when
Ignite is upgrade  from 2.8.0 to 2.8.1.  The data has been stored in the
disk (single node) running on Ignite 2.8.0. This exception happens for
persistence classes that do not implement java.io.serializable when
upgrading to 2.8.1.  Adding java.io.serializable does not resolve this
exception.  

In general when persistenceEnabled = true and the data is stored in the disk
1) how to resolve the discrepancies issues of Ignite internal implementation
between Ignite releases, i.e. the issue I'm experiencing.
2) how to resolve the key and value class changes (add/remove variables)

Thanks,
Xinmin




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
dmagda dmagda
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

Hi Xinmin,

Are you getting this error for your custom objects? If yes, did you change a type of a field in those objects?



-
Denis


On Tue, Sep 8, 2020 at 11:42 AM xmw45688 <[hidden email]> wrote:
Hi Denis,  I have the same issue when persistenceEnabled = true and when
Ignite is upgrade  from 2.8.0 to 2.8.1.  The data has been stored in the
disk (single node) running on Ignite 2.8.0. This exception happens for
persistence classes that do not implement java.io.serializable when
upgrading to 2.8.1.  Adding java.io.serializable does not resolve this
exception. 

In general when persistenceEnabled = true and the data is stored in the disk
1) how to resolve the discrepancies issues of Ignite internal implementation
between Ignite releases, i.e. the issue I'm experiencing.
2) how to resolve the key and value class changes (add/remove variables)

Thanks,
Xinmin




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
xmw45688 xmw45688
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

This post was updated on .
Hi Denis,

No, I don't change any types of fields. The data is stored in the disk with
Ignite 2.8.0. When I upgraded to 2.8.1, a serialization exception was
raised.  Adding java.io.serializable, generating serialVersionUID did not
help.  It seems that the data stored in the native persistence db has
generated different version of serialization class when upgrading from
Ignite 2.8.0 to 2.8.1.  

Any suggestion is appreciated.  

Caused by: java.io.InvalidClassException:
org.apache.ignite.cache.store.cassandra.persistence.PersistenceSettings;
local class incompatible: stream classdesc serialVersionUID =
1922252004176098172, local class serialVersionUID = 504991993937024313

BTW, the storage was setup as follows.  However I don't see /marshaller /wal directories.  Were are these directories?  I'm running Ignite server with Eclipse in my development work.

<property name="storagePath" value="c:/apache/data/np/partition/storage"/>.

storage directory structure

class org.apache.ignite.IgniteException: Failed to enrich cache configuration
[cacheName=Invoice]
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:129)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:62)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCacheInRecoveryMode(GridCacheProcessor.java:2268)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.access$1700(GridCacheProcessor.java:202)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor$CacheRecoveryLifecycle.afterBinaryMemoryRestore(GridCacheProcessor.java:5386)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreBinaryMemory(GridCacheDatabaseSharedManager.java:1075)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.startMemoryRestore(GridCacheDatabaseSharedManager.java:2049)
        at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1254)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2045)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
        at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
        at
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
        at org.apache.ignite.Ignition.start(Ignition.java:346)
        at
com.procurant.test.partition.FactPartitionNativePersistenceNoPrecachedTester.main(FactPartitionNativePersistenceNoPrecachedTester.java:71)
Caused by: class org.apache.ignite.IgniteException: Failed to deserialize
field storeFactory
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:154)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:122)
        ... 17 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
deserialize object with given class loader:
sun.misc.Launcher$AppClassLoader@4e25154f
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:132)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:139)
        at
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:81)
        at
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:10304)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:151)
        ... 18 more
Caused by: java.io.InvalidClassException:
org.apache.ignite.cache.store.cassandra.persistence.PersistenceSettings;
local class incompatible: stream classdesc serialVersionUID =
1922252004176098172, local class serialVersionUID = 504991993937024313



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
xmw45688 xmw45688
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

This post was updated on .
In reply to this post by dmagda
Hi Denis,
please help...

updated - I'm hitting the NPE bug (https://issues.apache.org/jira/browse/IGNITE-13431) because I'm using Cassandra as the data store, and key persistence strategy PRIMITIVE.  When I switched to a composite key, it worked.  

-- this fails
<persistence keyspace="ignitetest" table="dim_product">
    <keyPersistence class="java.lang.Long" strategy="PRIMITIVE"
column="id"/>
    <valuePersistence class="com.procurant.model.DimProduct" strategy="POJO"

    <field name="id" column="id" />
    <field name="name" column="name" />
    <field name="price" column="price" />
    <field name="qty" column="qty" />
    </valuePersistence>
</persistence>

-- this works
    <keyPersistence class="com.procurant.model.FactPurchaseLineKey" strategy="POJO">
                <partitionKey>
            <field name="id" column="id" />
            <field name="factId" column="factid" />
        </partitionKey>   
    </keyPersistence>


I'm trying to use Cassandra Persistence Together with Ignite Persistence
(https://apacheignite.readme.io/docs/3rd-party-store#:~:text=3rd%20Party%20Persistence-,Overview,database%20that%20persists%20the%20data.&text=
cache.,-integration.).
The Cassandra is used to store the data for the other applications.  This configuration with Ignite 2.8.1
works at the first start.  The data is inserted into the Cassandra store and
Ignite cache.  However, when the node stops and restarts with the data, the exception is
raised as follows.  What is missing from the configuration?

****
[21:02:14] Both Ignite native persistence and CacheStore are configured for cache 'DimProduct'. This configuration does not guarantee strict consistency between CacheStore and Ignite data storage upon restarts. Consult documentation for more details.
[21:02:14] Both Ignite native persistence and CacheStore are configured for cache 'DimStore'. This configuration does not guarantee strict consistency between CacheStore and Ignite data storage upon restarts. Consult documentation for more details.

****
[02:02:39] Message queue limit is set to 0 which may lead to potential OOMEs
when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due to
message queues growth on sender and receiver sides.
[02:02:39] Security status [authentication=off, tls/ssl=off]
[02:02:40] Ignite node stopped in the middle of checkpoint. Will restore
memory state and finish checkpoint on node start.
[2020-09-13 02:02:41,093][ERROR][main][IgniteKernal%MyCluster] Exception
during start processors, node will be stopped and close connections
class org.apache.ignite.IgniteException: Failed to enrich cache
configuration [cacheName=DimProduct]
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:129)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:62)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCacheInRecoveryMode(GridCacheProcessor.java:2268)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.access$1700(GridCacheProcessor.java:202)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor$CacheRecoveryLifecycle.afterBinaryMemoryRestore(GridCacheProcessor.java:5386)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreBinaryMemory(GridCacheDatabaseSharedManager.java:1075)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.startMemoryRestore(GridCacheDatabaseSharedManager.java:2049)
        at
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1254)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2045)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
        at
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
        at
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
        at org.apache.ignite.Ignition.start(Ignition.java:346)
        at
com.procurant.test.partition.FactPartitionNativePersistenceSimpleTester.main(FactPartitionNativePersistenceSimpleTester.java:71)
Caused by: class org.apache.ignite.IgniteException: Failed to deserialize
field storeFactory
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:154)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:122)
        ... 17 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
deserialize object with given class loader:
sun.misc.Launcher$AppClassLoader@764c12b6
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:132)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:139)
        at
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:81)
        at
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:10304)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:151)
        ... 18 more
Caused by: java.lang.NullPointerException
        at
java.util.Collections$UnmodifiableCollection.<init>(Collections.java:1026)
        at
java.util.Collections$UnmodifiableList.<init>(Collections.java:1302)
        at java.util.Collections.unmodifiableList(Collections.java:1287)
        at
org.apache.ignite.cache.store.cassandra.persistence.PersistenceSettings.readObject(PersistenceSettings.java:533)
        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
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1170)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2178)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:124)
        ... 22 more
[2020-09-13 02:02:41,099][ERROR][main][IgniteKernal%MyCluster] Got exception
while starting (will rollback startup routine).
class org.apache.ignite.IgniteException: Failed to enrich cache
configuration [cacheName=DimProduct]
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:129)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:62)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCacheInRecoveryMode(GridCacheProcessor.java:2268)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.access$1700(GridCacheProcessor.java:202)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor$CacheRecoveryLifecycle.afterBinaryMemoryRestore(GridCacheProcessor.java:5386)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreBinaryMemory(GridCacheDatabaseSharedManager.java:1075)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.startMemoryRestore(GridCacheDatabaseSharedManager.java:2049)
        at
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1254)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2045)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
        at
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
        at
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
        at org.apache.ignite.Ignition.start(Ignition.java:346)
        at
com.procurant.test.partition.FactPartitionNativePersistenceSimpleTester.main(FactPartitionNativePersistenceSimpleTester.java:71)
Caused by: class org.apache.ignite.IgniteException: Failed to deserialize
field storeFactory
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:154)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:122)
        ... 17 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
deserialize object with given class loader:
sun.misc.Launcher$AppClassLoader@764c12b6
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:132)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:139)
        at
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:81)
        at
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:10304)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:151)
        ... 18 more
Caused by: java.lang.NullPointerException
        at
java.util.Collections$UnmodifiableCollection.<init>(Collections.java:1026)
        at
java.util.Collections$UnmodifiableList.<init>(Collections.java:1302)
        at java.util.Collections.unmodifiableList(Collections.java:1287)
        at
org.apache.ignite.cache.store.cassandra.persistence.PersistenceSettings.readObject(PersistenceSettings.java:533)
        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
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1170)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2178)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:124)
        ... 22 more
[02:02:41] Ignite node stopped OK [name=MyCluster, uptime=00:00:03.371]
Exception in thread "main" class org.apache.ignite.IgniteException: Failed
to enrich cache configuration [cacheName=DimProduct]
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:129)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:62)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCacheInRecoveryMode(GridCacheProcessor.java:2268)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.access$1700(GridCacheProcessor.java:202)
        at
org.apache.ignite.internal.processors.cache.GridCacheProcessor$CacheRecoveryLifecycle.afterBinaryMemoryRestore(GridCacheProcessor.java:5386)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.restoreBinaryMemory(GridCacheDatabaseSharedManager.java:1075)
        at
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.startMemoryRestore(GridCacheDatabaseSharedManager.java:2049)
        at
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1254)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2045)
        at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
        at
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
        at
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
        at org.apache.ignite.Ignition.start(Ignition.java:346)
        at
com.procurant.test.partition.FactPartitionNativePersistenceSimpleTester.main(FactPartitionNativePersistenceSimpleTester.java:71)
Caused by: class org.apache.ignite.IgniteException: Failed to deserialize
field storeFactory
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:154)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.enrich(CacheConfigurationEnricher.java:122)
        ... 17 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
deserialize object with given class loader:
sun.misc.Launcher$AppClassLoader@764c12b6
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:132)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:139)
        at
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:81)
        at
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:10304)
        at
org.apache.ignite.internal.processors.cache.CacheConfigurationEnricher.deserialize(CacheConfigurationEnricher.java:151)
        ... 18 more
Caused by: java.lang.NullPointerException
        at
java.util.Collections$UnmodifiableCollection.<init>(Collections.java:1026)
        at
java.util.Collections$UnmodifiableList.<init>(Collections.java:1302)
        at java.util.Collections.unmodifiableList(Collections.java:1287)
        at
org.apache.ignite.cache.store.cassandra.persistence.PersistenceSettings.readObject(PersistenceSettings.java:533)
        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
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1170)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2178)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:124)
        ... 22 more
Press any key to continue . . .
 
configuration

<persistence keyspace="ignitetest" table="dim_product">
    <keyPersistence class="java.lang.Long" strategy="PRIMITIVE"
column="id"/>
    <valuePersistence class="com.procurant.model.DimProduct" strategy="POJO"

    <field name="id" column="id" />
    <field name="name" column="name" />
    <field name="price" column="price" />
    <field name="qty" column="qty" />
    </valuePersistence>
</persistence>

    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
               
                <property name="igniteInstanceName" value="MyCluster"/>
            <property name="peerClassLoadingEnabled" value="true"/>


                <property name="workDirectory" value="/c:/apache/data/home/work"/>
                       
        <property name="dataStorageConfiguration">
            <bean
class="org.apache.ignite.configuration.DataStorageConfiguration">
                       
                <property name="defaultDataRegionConfiguration">
                    <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="name" value="Default_Region"/>
                        <property name="initialSize" value="#{10L * 1024 *
1024}"/>
                       
                        <property name="maxSize" value="#{5L * 1024 * 1024 *
1024}"/>
                       
           
                        <property name="persistenceEnabled" value="true"/>
                    </bean>
                </property>
                <property name="storagePath"
value="c:/apache/data/simple/storage"/>
                <property name="walFlushFrequency" value="10000"/>
                <property name="walMode" value="LOG_ONLY"/>
                <property name="walPath" value="c:/apache/data/simple/wal"/>
                <property name="walArchivePath"
value="c:/apache/data/simple/wal/archive"/>                                                         
            </bean>
        </property>
       
        <property name="cacheConfiguration">
            <list>
                <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="DimProduct"/>
                    <property name="cacheMode" value="REPLICATED"/>
                    <property name="atomicityMode" value="TRANSACTIONAL"/>                   
                    <property name="readThrough" value="true"/>
                    <property name="writeThrough" value="true"/>                   
                    <property name="sqlSchema" value="partition"/>
                    <property name="indexedTypes">
                        <list>
                            <value
type="java.lang.Class">java.lang.Long</value>
                            <value
type="java.lang.Class">com.procurant.model.DimProduct</value>
                        </list>
                    </property>
                   
                    <property name="cacheStoreFactory">
                        <bean
class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
                            <property name="dataSource" ref="cassandra"/>
                            <property name="persistenceSettingsBean"
value="dim_product_persistence_settings"></property>
                        </bean>
                    </property>                   
                </bean>
               
               
            </list>
        </property>




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
xmw45688 xmw45688
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

Hi Denis,

updated - I'm hitting the NPE bug
(https://issues.apache.org/jira/browse/IGNITE-13431) because I'm using
Cassandra as the data store, and key persistence strategy PRIMITIVE in the
original test.  When I switched to a composite key, it worked.  Not when
this bug gets fixed.  

-- this fails
<persistence keyspace="ignitetest" table="dim_product">
    <keyPersistence class="java.lang.Long" strategy="PRIMITIVE"
column="id"/>
    <valuePersistence class="com.procurant.model.DimProduct" strategy="POJO"
>
    <field name="id" column="id" />
    <field name="name" column="name" />
    <field name="price" column="price" />
    <field name="qty" column="qty" />
    </valuePersistence>
</persistence>

-- this works
    <keyPersistence class="com.procurant.model.FactPurchaseLineKey"
strategy="POJO">
                <partitionKey>
            <field name="id" column="id" />
            <field name="factId" column="factid" />
        </partitionKey>    
    </keyPersistence>



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/