You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "kcheng.mvp (JIRA)" <ji...@apache.org> on 2015/08/13 17:33:45 UTC

[jira] [Commented] (IGNITE-1246) Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Failed to validate cache configuration. Cache store factory is not serializable. Cache name: XXXXXXX

    [ https://issues.apache.org/jira/browse/IGNITE-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695368#comment-14695368 ] 

kcheng.mvp commented on IGNITE-1246:
------------------------------------

Maybe it's not a bug. but in this case, what should I do?

I just need to copy the configuration to the all the server nodes?

for my case , as I need to load 7 db tables into 7 caches. I using spring {code:java}org.apache.ignite.IgniteSpringBean{code} to starts Ignite and at the same time define a SpringBean as 
CacheConfiguration template.
{code:xml}
<bean id="cache.cfg" class="org.apache.ignite.configuration.CacheConfiguration" scope="prototype">
		<property name="memoryMode" value="OFFHEAP_TIERED" />
		<property name="offHeapMaxMemory" value="#{4 * 1024L * 1024L * 1024L}" />
		<property name="atomicityMode" value="ATOMIC" />
		<property name="backups" value="1" />
		<!-- 
		<property name="interceptor">
			<bean class="com.fangcang.cache.core.interceptor.IncrInterceptor" />
		</property>
		 -->
		<property name="cacheStoreFactory">
			<bean class="javax.cache.configuration.FactoryBuilder$SingletonFactory">
				<constructor-arg>
					<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore">
						<property name="dataSource" ref="dataSource"/>
					</bean>
				</constructor-arg>
			</bean>
		</property>
	</bean>
{code}
and create the CacheConfiguration by {code}ignite-schema-import.sh{code} for each table, so I just need to set the table specific setting to the template.




> Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Failed to validate cache configuration. Cache store factory is not serializable. Cache name: XXXXXXX
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-1246
>                 URL: https://issues.apache.org/jira/browse/IGNITE-1246
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: kcheng.mvp
>
> Here is my configuration
> {code:xml}
> <bean id="dataSource"
> 		class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> 		<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
> 		<property name="url"
> 			value="jdbc:oracle:thin:@//192.168.2.39:1521/db" />
> 		<property name="username" value="abc" />
> 		<property name="password" value="abc" />
> 	</bean>
> <bean id="cache.cfg" class="org.apache.ignite.configuration.CacheConfiguration">
> 		<property name="memoryMode" value="OFFHEAP_TIERED" />
> 		<property name="offHeapMaxMemory" value="#{4 * 1024L * 1024L * 1024L}" />
> 		<property name="atomicityMode" value="ATOMIC" />
> 		<property name="backups" value="1" />
> 		<!-- 
> 		<property name="interceptor">
> 			<bean class="com.fangcang.cache.core.interceptor.IncrInterceptor" />
> 		</property>
> 		 -->
> 		<property name="cacheStoreFactory">
> 			<bean class="javax.cache.configuration.FactoryBuilder$SingletonFactory">
> 				<constructor-arg>
> 					<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore">
> 						<property name="dataSource" ref="dataSource"/>
> 					</bean>
> 				</constructor-arg>
> 			</bean>
> 		</property>
> 	</bean>
> {code}
> When I try to load data to the cache I got the exception.
> here is he stack from client node
> {code}
> Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Failed to validate cache configuration. Cache store factory is not serializable. Cache name: T_HTLPRO_PRICEPLAN
> 	at org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1581)
> 	at org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2311)
> 	at org.apache.ignite.IgniteSpringBean.getOrCreateCache(IgniteSpringBean.java:246)
> 	at com.fangcang.cache.client.Grid.getCacheByCfg(Grid.java:30)
> 	at com.fangcang.cache.client.InitLoader.main(InitLoader.java:16)
> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to validate cache configuration. Cache store factory is not serializable. Cache name: T_HTLPRO_PRICEPLAN
> 	at org.apache.ignite.internal.processors.cache.GridCacheProcessor.checkSerializable(GridCacheProcessor.java:3038)
> 	at org.apache.ignite.internal.processors.cache.GridCacheProcessor.dynamicStartCache(GridCacheProcessor.java:1958)
> 	at org.apache.ignite.internal.processors.cache.GridCacheProcessor.dynamicStartCache(GridCacheProcessor.java:1927)
> 	at org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2306)
> 	... 3 more
> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to serialize object: javax.cache.configuration.FactoryBuilder$SingletonFactory@55dfebeb
> 	at org.apache.ignite.marshaller.jdk.JdkMarshaller.marshal(JdkMarshaller.java:78)
> 	at org.apache.ignite.marshaller.AbstractMarshaller.marshal(AbstractMarshaller.java:51)
> 	at org.apache.ignite.internal.processors.cache.GridCacheProcessor.checkSerializable(GridCacheProcessor.java:3034)
> 	... 6 more
> Caused by: java.io.NotSerializableException: org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore
> 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
> 	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
> 	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
> 	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
> 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
> 	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
> 	at org.apache.ignite.marshaller.jdk.JdkMarshaller.marshal(JdkMarshaller.java:73)
> 	... 8 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)