1 Reply Latest reply: Jun 18, 2012 11:27 AM by 665356 RSS

    DistributedCache after restart could not find store

    705676
      Hello,

      I have two node cluster and the application has distributed cache configured via coherence-cache-config.xml. When i first time deployed the application there is no error but if restart one node then the node restarted throws this exception

      Caused by: java.lang.RuntimeException: The coherence cache configuration file expects a store to be configured for cache 'apnFixCache' , but no store is configured for 'apnFixCache' in the Spring application context.

      coherence-cache-config.xml:
      <?xml version="1.0"?>
      <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
      <cache-config>

           <caching-scheme-mapping>
                <cache-mapping>
                     <cache-name>galataSegmentedCustomerCache</cache-name>
                     <scheme-name>localSegmented</scheme-name>
                </cache-mapping>
                <cache-mapping>
                     <cache-name>apnFixCache</cache-name>
                     <scheme-name>galata-distributed-apn</scheme-name>
                </cache-mapping>
           </caching-scheme-mapping>


           <caching-schemes>
                <local-scheme>
                     <scheme-name>localSegmented</scheme-name>
                     <expiry-delay>6h</expiry-delay>
                     <eviction-policy>LRU</eviction-policy>
                     <high-units>800000</high-units>
                     <low-units>300000</low-units>
                     <cachestore-scheme>
                          <class-scheme>
                               <class-factory-name>com.bea.wlevs.cache.coherence.configuration.SpringFactory</class-factory-name>
                               <method-name>getLoader</method-name>
                               <init-params>
                                    <init-param>
                                         <param-type>java.lang.String</param-type>
                                         <param-value>{cache-name}</param-value>
                                    </init-param>
                               </init-params>
                          </class-scheme>
                     </cachestore-scheme>
                </local-scheme>
                <local-scheme>
                     <scheme-name>distributed-scheme-back</scheme-name>
                     <eviction-policy>LRU</eviction-policy>
                     <high-units>600</high-units>
                     <low-units>300</low-units>
                     <unit-calculator>BINARY</unit-calculator>
                     <unit-factor>1048576</unit-factor>
                </local-scheme>

                <distributed-scheme>
                     <backup-count>0</backup-count>
                     <scheme-name>galata-distributed-apn</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <thread-count>150</thread-count>
                     <task-timeout>0</task-timeout>
                     <request-timeout>0</request-timeout>
                     <backing-map-scheme>
                          <read-write-backing-map-scheme>
                               <cachestore-timeout>0</cachestore-timeout>
                               <internal-cache-scheme>
                                    <local-scheme>
                                         <scheme-ref>distributed-scheme-back</scheme-ref>
                                    </local-scheme>
                               </internal-cache-scheme>
                               <cachestore-scheme>
                                    <class-scheme>
                                         <class-factory-name>com.bea.wlevs.cache.coherence.configuration.SpringFactory</class-factory-name>
                                         <method-name>getStore</method-name>
                                         <init-params>
                                              <init-param>
                                                   <param-type>java.lang.String</param-type>
                                                   <param-value>{cache-name}</param-value>
                                              </init-param>
                                         </init-params>
                                    </class-scheme>
                               </cachestore-scheme>
                          </read-write-backing-map-scheme>
                     </backing-map-scheme>
                     <autostart>true</autostart>
                </distributed-scheme>
           </caching-schemes>
      </cache-config>

      and spring context:

           <wlevs:caching-system id="galataCache" provider="coherence"
                advertise="false" />

           <wlevs:cache id="galataSegmentedCustomerCache" advertise="false">
                <wlevs:caching-system ref="galataCache" />
                <wlevs:cache-loader ref="customerCacheLoader" />
           </wlevs:cache>

           <wlevs:cache id="apnFixCache" advertise="false">
                <wlevs:caching-system ref="galataCache" />
                <wlevs:cache-store ref="apnValuesCacheStore" />
           </wlevs:cache>

           <bean id="emptyCustomer"
                class="com.globalmaksimum.galataapn.domain.SegmentedEmptyCustomer" />

           <bean id="customerCacheLoader"
                class="com.globalmaksimum.galata.cache.customer.coherence.CustomerLoader">
                <property name="repository" ref="customerRepository" />
                <property name="hasEmptyCustomer" ref="emptyCustomer" />
           </bean>

           <bean id="apnValuesCacheStore"
                class="com.globalmaksimum.galataapn.persistence.ImsiApnLastCheckStore">
                <property name="apnLastCheckValuesRepository" ref="apnLastCheckValuesRepository" />
           </bean>