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

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

In order to simply the question, I did a very simple test with below 
configuration.

server.xml
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>

<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor 
        license agreements. See the NOTICE file distributed with this work for 
additional 
        information regarding copyright ownership. The ASF licenses this file 
to 
        You under the Apache License, Version 2.0 (the "License"); you may not 
use 
        this file except in compliance with the License. You may obtain a copy 
of 
        the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required 
        by applicable law or agreed to in writing, software distributed under 
the 
        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS 
        OF ANY KIND, either express or implied. See the License for the 
specific 
        language governing permissions and limitations under the License. -->

<!-- Ignite Spring configuration file to startup Ignite cache. This file 
        demonstrates how to configure cache using Spring. Provided cache will 
be 
        created on node startup. Use this configuration file when running HTTP 
REST 
        examples (see 'examples/rest' folder). When starting a standalone node, 
you 
        need to execute the following command: 
{IGNITE_HOME}/bin/ignite.{bat|sh} 
        examples/config/cache.xml When starting Ignite from Java IDE, pass path 
to 
        this file to Ignition: Ignition.start("examples/config/cache.xml"); -->
<beans xmlns="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";>



        <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/mydb" />
                <property name="username" value="abc" />
                <property name="password" value="abc123" />
        </bean>

        

        <bean id="ignite.cfg" 
class="org.apache.ignite.configuration.IgniteConfiguration">
                <property name="clientMode" value="true" />
                <property name="peerClassLoadingEnabled" value="false" />
                <property name="marshaller">
                        <bean 
class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
                                <property name="requireSerializable" 
value="false" />
                        </bean>
                </property>
                
                <property name="cacheConfiguration">
                        <list>
                                <ref bean="cache.cfg"/>
                        </list>
                </property>

                <property name="discoverySpi">
                        <bean 
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                                <property name="ipFinder">
                                        <!-- Ignite provides several options 
for automatic discovery that can 
                                                be used instead os static IP 
based discovery. For information on all options 
                                                refer to our documentation: 
http://apacheignite.readme.io/docs/cluster-config -->
                                        <!-- Uncomment static IP finder to 
enable static-based discovery of 
                                                initial nodes. -->
                                        <!--<bean 
class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> 
-->
                                        <bean
                                                
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                                                <property name="multicastGroup" 
value="228.1.2.6" />
                                                <property name="addresses">
                                                        <list>
                                                                
<value>192.168.2.185</value>
                                                                
<value>192.168.2.186</value>
                                                                
<value>192.168.2.187</value>
                                                        </list>
                                                </property>
                                        </bean>
                                </property>
                        </bean>
                </property>
        </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="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>


</beans>

{code}

and start a node with this command
{code}./ignite.sh ../config/server.xml{code}

got the same error

{code}
[07:45:04,339][ERROR][main][IgniteKernal] Got exception while starting (will 
rollback startup routine).
class org.apache.ignite.IgniteCheckedException: Failed to start processor: 
GridProcessorAdapter []
        at 
org.apache.ignite.internal.IgniteKernal.startProcessor(IgniteKernal.java:1388)
        at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:772)
        at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1538)
        at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1405)
        at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:931)
        at 
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:858)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:750)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:671)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:527)
        at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:497)
        at org.apache.ignite.Ignition.start(Ignition.java:346)
        at 
org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:289)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to validate 
cache configuration. Cache store factory is not serializable. Cache name: 
default
        at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.checkSerializable(GridCacheProcessor.java:3038)
        at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.start(GridCacheProcessor.java:582)
        at 
org.apache.ignite.internal.IgniteKernal.startProcessor(IgniteKernal.java:1385)
        ... 11 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to serialize 
object: javax.cache.configuration.FactoryBuilder$SingletonFactory@2d7275fc
        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)
        ... 13 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)
        ... 15 more

{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: 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" 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}
> 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)

Reply via email to