9 Replies Latest reply: Apr 26, 2013 2:53 PM by 877490 RSS

    Push Replication - Active-Active cache

    877490
      Hi,

      I'm getting the below error in the server-1 when trying to put the string test data for active-active cache with push replication. I have added only few jar files in the server class path(not all the jars from push replication example project)

      Jar in the server path:
      set CLASSPATH=^
      C:\Coherence\Replication-1;^
      C:\Coherence\Replication-1\lib\coherence-pushreplicationpattern-4.0.6.39174;^
      C:\Coherence\Replication-1\lib\coherence-common-2.3.0.39174.jar;^
      C:\Coherence\Replication-1\lib\coherence-messagingpattern-2.8.6.39174.jar;^
      C:\Coherence\Replication-1\lib\coherence-commandpattern-2.8.5.39174.jar;^
      C:\Coherence\Replication-1\lib\coherence-eventdistributionpattern-1.2.2.39174.jar;^
      C:\Coherence\Replication-1\lib\coherence-functorpattern-1.5.5.39174.jar;^
      C:\Coherence\Replication-1\lib\coherence-processingpattern-1.4.4.39174.jar;^
      C:\coherence\Replication-1\lib\coherence.jar;^
      C:\coherence\Replication-1\lib\activemq-core-5.3.1.jar;^
      C:\coherence\Replication-1\lib\geronimo-jms_1.1_spec-1.1.1.jar;^
      C:\coherence\lib\log4j-1.2.15.jar;


      Error:

      *2013-04-18 16:05:11,477 Coherence Logger@9250185 3.7.1.6 ERROR 2013-04-18 16:05:11.477/119.202 Oracle Coherence GE 3.7.1.6 <Error> (thread=DistributedCache:DistributedCacheWithPublishingCacheStore, member=1): BackingMapManager com.tangosol.net.DefaultConfigurableCacheFactory$Manager: failed to instantiate a cache: publishing-cache*
      *2013-04-18 16:05:11,477 Coherence Logger@9250185 3.7.1.6 ERROR 2013-04-18 16:05:11.477/119.202 Oracle Coherence GE 3.7.1.6 <Error> (thread=DistributedCache:DistributedCacheWithPublishingCacheStore, member=1):*

      java.lang.IllegalArgumentException: No scheme for cache: "publishing-cache"at com.tangosol.net.DefaultConfigurableCacheFactory.findSchemeMapping(DefaultConfigurableCacheFactory.java:542)
      at com.tangosol.net.DefaultConfigurableCacheFactory$Manager.instantiateBackingMap(DefaultConfigurableCacheFactory.java:4105)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.instantiateBackingMap(PartitionedCache.CDB:24)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.setCacheName(PartitionedCache.CDB:25)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ServiceConfig$ConfigListener.entryInserted(PartitionedCache.CDB:17)
      at com.tangosol.util.MapEvent.dispatch(MapEvent.java:266)
      at com.tangosol.util.MapEvent.dispatch(MapEvent.java:226)
      at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:567)
      at com.tangosol.util.ObservableHashMap.dispatchEvent(ObservableHashMap.java:242)
      at com.tangosol.util.ObservableHashMap$Entry.onAdd(ObservableHashMap.java:283)
      at com.tangosol.util.SafeHashMap.put(SafeHashMap.java:244)
      at com.tangosol.util.ObservableHashMap.put(ObservableHashMap.java:62)

      Thanks in advance.

      Server Cache config:

      Server Cache Config:
      <caching-schemes>
      <caching-scheme-mapping>
      <cache-mapping>
      <cache-name>publishing-cache</cache-name>
      <scheme-name>distributed-scheme-with-publishing-cachestore</scheme-name>


      <event:distributor>
      <event:distributor-name>{cache-name}</event:distributor-name>
      <event:distributor-external-name>{site-name}-{cluster-name}-{cache-name}</event:distributor-external-name>


      <event:distributor-scheme>
      <event:coherence-based-distributor-scheme/>
      </event:distributor-scheme>


      <event:distribution-channels>
      <event:distribution-channel>
      <event:channel-name>Active1 Publisher</event:channel-name>
      <event:starting-mode system-property="channel.starting.mode">enabled</event:starting-mode>


      <event:channel-scheme>
      <event:remote-cluster-channel-scheme>
      <event:remote-invocation-service-name>remote-site2</event:remote-invocation-service-name>
      <event:remote-channel-scheme>
      <event:local-cache-channel-scheme>
      <event:target-cache-name>publishing-cache</event:target-cache-name>
      <event:conflict-resolver-scheme>
      <cr:class classname="com.oracle.coherence.examples.incubator.pushreplicationpattern.activeactive.ActiveActiveSumConflictResolver"/>
      </event:conflict-resolver-scheme>
      </event:local-cache-channel-scheme>
      </event:remote-channel-scheme>
      </event:remote-cluster-channel-scheme>
      </event:channel-scheme>
      </event:distribution-channel>
      </event:distribution-channels>
      </event:distributor>
      </cache-mapping>
      </caching-scheme-mapping>


      <!--
      The following scheme is required for each remote-site when
      using a RemoteInvocationPublisher
      -->
      <remote-invocation-scheme>
      <service-name>remote-site2</service-name>
      <initiator-config>
      <tcp-initiator>
      <remote-addresses>
      <socket-address>
      <address>localhost</address>
      <port>20002</port>
      </socket-address>
      </remote-addresses>
      <connect-timeout>2s</connect-timeout>
      </tcp-initiator>
      <outgoing-message-handler>
      <request-timeout>5s</request-timeout>
      </outgoing-message-handler>
      </initiator-config>
      </remote-invocation-scheme>


      <distributed-scheme>
      <scheme-name>distributed-scheme-with-publishing-cachestore</scheme-name>
      <service-name>DistributedCacheWithPublishingCacheStore</service-name>


      <backing-map-scheme>
      <read-write-backing-map-scheme>
      <internal-cache-scheme>
      <local-scheme>
      </local-scheme>
      </internal-cache-scheme>
      <cachestore-scheme>
      <class-scheme>
      <class-name>com.oracle.coherence.patterns.pushreplication.PublishingCacheStore</class-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>


      <proxy-scheme>
      <service-name>ExtendTcpProxyService</service-name>
      <acceptor-config>
      <tcp-acceptor>
      <local-address>
      <address>localhost</address>
      <port>20001</port>
      </local-address>
      </tcp-acceptor>
      </acceptor-config>
      <autostart>true</autostart>
      </proxy-scheme>


      <!-- END: com.oracle.coherence.patterns.pushreplication -->
      </caching-schemes>



      - Raj.
        • 1. Re: Push Replication - Active-Active cache
          Jonathan.Knight
          Hi Raj,

          Your cache configuration file is wrong, you have everything inside <caching-schemes> and you have no root level <cache-config> element with the relevant namespaces in it.

          You should really be validating your XML configuration files against the XSD files in the Coherence jar.

          JK

          Edited by: Jonathan.Knight on Apr 23, 2013 8:22 AM
          • 2. Re: Push Replication - Active-Active cache
            877490
            Hi JK,

            Thanks for your response. I hope you are right.

            I didn't make any change in the config files and looks like problem with example itself. The URL is below

            http://coherence.oracle.com/display/INC10/coherence-pushreplication-pattern-examples



            Thanks,
            Raj.
            • 3. Re: Push Replication - Active-Active cache
              user639604
              The cache config file you posted is different than the one inside the example package. Or you only posted partial of the cache config file you were using?
              • 4. Re: Push Replication - Active-Active cache
                877490
                Thanks. I have posted entire config file from example. File name is *"active1-cache-config.xml"*

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

                <!--
                     File: active1-cache-config.xml
                     
                     Copyright (c) 2008-2009. All Rights Reserved. Oracle Corporation.

                     Oracle is a registered trademark of Oracle Corporation and/or its
                     affiliates.

                     This software is the confidential and proprietary information of Oracle
                     Corporation. You shall not disclose such confidential and proprietary
                     information and shall use it only in accordance with the terms of the
                     license agreement you entered into with Oracle Corporation.

                     Oracle Corporation makes no representations or warranties about
                     the suitability of the software, either express or implied,
                     including but not limited to the implied warranties of
                     merchantability, fitness for a particular purpose, or
                     non-infringement. Oracle Corporation shall not be liable for
                     any damages suffered by licensee as a result of using, modifying
                     or distributing this software or its derivatives.

                     This notice may not be removed or altered.
                -->

                <cache-config xmlns:element="class://com.oracle.coherence.environment.extensible.namespaces.XmlElementProcessingNamespaceContentHandler"
                xmlns:event="class://com.oracle.coherence.patterns.eventdistribution.configuration.EventDistributionNamespaceContentHandler"
                xmlns:cr="class:com.oracle.coherence.environment.extensible.namespaces.InstanceNamespaceContentHandler">

                <defaults>
                <serializer>pof</serializer>
                </defaults>

                <caching-schemes>
                <caching-scheme-mapping>
                <cache-mapping>
                <cache-name>publishing-cache</cache-name>
                <scheme-name>distributed-scheme-with-publishing-cachestore</scheme-name>

                <event:distributor>
                <event:distributor-name>{cache-name}</event:distributor-name>
                <event:distributor-external-name>{site-name}-{cluster-name}-{cache-name}</event:distributor-external-name>

                <event:distributor-scheme>
                <event:coherence-based-distributor-scheme/>
                </event:distributor-scheme>

                <event:distribution-channels>
                <event:distribution-channel>
                <event:channel-name>Active1 Publisher</event:channel-name>
                <event:starting-mode system-property="channel.starting.mode">enabled</event:starting-mode>

                <event:channel-scheme>
                <event:remote-cluster-channel-scheme>
                <event:remote-invocation-service-name>remote-site2</event:remote-invocation-service-name>
                <event:remote-channel-scheme>
                <event:local-cache-channel-scheme>
                <event:target-cache-name>publishing-cache</event:target-cache-name>
                <event:conflict-resolver-scheme>
                <cr:class classname="com.oracle.coherence.examples.incubator.pushreplicationpattern.activeactive.ActiveActiveSumConflictResolver"/>
                </event:conflict-resolver-scheme>
                </event:local-cache-channel-scheme>
                </event:remote-channel-scheme>
                </event:remote-cluster-channel-scheme>
                </event:channel-scheme>
                </event:distribution-channel>
                </event:distribution-channels>
                </event:distributor>
                </cache-mapping>
                </caching-scheme-mapping>


                <!--
                The following scheme is required for each remote-site when
                using a RemoteInvocationPublisher
                -->
                <remote-invocation-scheme>
                <service-name>remote-site2</service-name>
                <initiator-config>
                <tcp-initiator>
                <remote-addresses>
                <socket-address>
                <address>localhost</address>
                <port>20002</port>
                </socket-address>
                </remote-addresses>
                <connect-timeout>2s</connect-timeout>
                </tcp-initiator>
                <outgoing-message-handler>
                <request-timeout>5s</request-timeout>
                </outgoing-message-handler>
                </initiator-config>
                </remote-invocation-scheme>

                <distributed-scheme>
                <scheme-name>distributed-scheme-with-publishing-cachestore</scheme-name>
                <service-name>DistributedCacheWithPublishingCacheStore</service-name>

                <backing-map-scheme>
                <read-write-backing-map-scheme>
                <internal-cache-scheme>
                <local-scheme>
                </local-scheme>
                </internal-cache-scheme>
                <cachestore-scheme>
                <class-scheme>
                <class-name>com.oracle.coherence.patterns.pushreplication.PublishingCacheStore</class-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>

                <proxy-scheme>
                <service-name>ExtendTcpProxyService</service-name>
                <acceptor-config>
                <tcp-acceptor>
                <local-address>
                <address>localhost</address>
                <port>20001</port>
                </local-address>
                </tcp-acceptor>
                </acceptor-config>
                <autostart>true</autostart>
                </proxy-scheme>

                <!-- END: com.oracle.coherence.patterns.pushreplication -->
                </caching-schemes>
                </cache-config>
                • 5. Re: Push Replication - Active-Active cache
                  Jonathan.Knight
                  Hi,

                  If you have not added all the jar files from the example onto the classpath then you will not have the conflict resolver specified in the configuration com.oracle.coherence.examples.incubator.pushreplicationpattern.activeactive.ActiveActiveSumConflictResolver anywhere which could be causing your problem. Although the error says java.lang.IllegalArgumentException: No scheme for cache: "publishing-cache" this may just be the top level exception and the underlying cause may be a ClassNotFoundException for the conflict resolver.

                  JK
                  • 6. Re: Push Replication - Active-Active cache
                    877490
                    Thanks, JK. I have added all the jar files and still didn't help.


                    set CLASSPATH=^
                    C:\Coherence\Replication-1;^
                    C:\Coherence\Replication-1\lib\coherence-pushreplicationpattern-4.0.6.39174;^
                    C:\Coherence\Replication-1\lib\coherence-common-2.3.0.39174.jar;^
                    C:\Coherence\Replication-1\lib\coherence-messagingpattern-2.8.6.39174.jar;^
                    C:\Coherence\Replication-1\lib\coherence-commandpattern-2.8.5.39174.jar;^
                    C:\Coherence\Replication-1\lib\coherence-eventdistributionpattern-1.2.2.39174.jar;^
                    C:\Coherence\Replication-1\lib\coherence-functorpattern-1.5.5.39174.jar;^
                    C:\Coherence\Replication-1\lib\coherence-processingpattern-1.4.4.39174.jar;^
                    C:\coherence\Replication-1\lib\activemq-core-5.3.1.jar;^
                    C:\coherence\Replication-1\lib\geronimo-jms_1.1_spec-1.1.1.jar;^
                    C:\coherence\lib\log4j-1.2.15.jar;^
                    C:\Coherence\Replication-1\lib\activemq-protobuf-1.0.jar;^
                    C:\Coherence\Replication-1\lib\aopalliance-1.0.jar;^
                    C:\Coherence\Replication-1\lib\asm-3.3.1.jar;^
                    C:\Coherence\Replication-1\lib\cglib-2.2.2.jar;^
                    C:\Coherence\Replication-1\lib\commons-logging-1.1.jar;^
                    C:\Coherence\Replication-1\lib\commons-logging-api-1.1.jar;^
                    C:\Coherence\Replication-1\lib\commons-net-2.0.jar;^
                    C:\Coherence\Replication-1\lib\geronimo-j2ee-management_1.0_spec-1.0.jar;^
                    C:\Coherence\Replication-1\lib\hamcrest-core-1.2.1.jar;^
                    C:\Coherence\Replication-1\lib\hamcrest-integration-1.2.1.jar;^
                    C:\Coherence\Replication-1\lib\hamcrest-library-1.2.1.jar;^
                    C:\Coherence\Replication-1\lib\kahadb-5.3.1.jar;^
                    C:\Coherence\Replication-1\lib\miglayout-3.6.3.jar;^
                    C:\Coherence\Replication-1\lib\org.osgi.core-4.1.0.jar;^
                    C:\Coherence\Replication-1\lib\spring-beans-2.5.6.jar;^
                    C:\Coherence\Replication-1\lib\spring-context-2.5.6.jar;^
                    C:\Coherence\Replication-1\lib\spring-core-2.5.6.jar;^
                    C:\Coherence\Replication-1\lib\spring-osgi-core-1.2.1.jar;^
                    C:\Coherence\Replication-1\lib\spring-osgi-io-1.2.1.jar;^
                    C:\coherence\Replication-1\lib\coherence.jar;
                    • 7. Re: Push Replication - Active-Active cache
                      Jonathan.Knight
                      Hi,

                      In that list of class path entries I cannot see one where the com.oracle.coherence.examples.incubator.pushreplicationpattern.activeactive.ActiveActiveSumConflictResolver class would be. You are using an old version of the Incubator that I do not have at the moment so I am not sure which jar file or location that class should be, but I am pretty sure it is not any that are in your list (assuming of course that this is your problem).

                      You should try the latest Incubator 11 http://coherence-community.github.io/coherence-incubator/11.0.0/ which is now better documented and easier to build as it is all on Maven. I suspect the examples are easier to run too.

                      JK
                      • 8. Re: Push Replication - Active-Active cache
                        user639604
                        ActiveActiveSumConflictResolver class is part of the Java files included in the example, it won't be in any of those jar files. Please make sure you have those Java files compiled and included in the class path. i.e. make sure they are under your C:\Coherence\Replication-1 directory.
                        • 9. Re: Push Replication - Active-Active cache
                          877490
                          JK,

                          I placed the ActiveActiveSumConflictResolve only class as a jar file and still didn't work. I'm not running the same example code and trying to test with simple string text messge.

                          My test case is like below

                          - Coherence cluster is running in the SITE 1
                          - Another coherence cluster is running in SITE 2
                          - Publisher one and two is running

                          I'm getting the exception when trying to put the text message from publisher one. I'm seeing the below exception in cluster SITE -1.

                          2013-04-26 14:36:03,722 Coherence Logger@9214443 3.7.1.6 ERROR 2013-04-26 14:36:03.722/177.433 Oracle Coherence GE 3.7.1.6 <Error> (thread=DistributedCache:DistributedCacheWithPublishingCacheStore, member=1): BackingMapManager com.tangosol.net.DefaultConfigurableCacheFactory$Manager: failed to instantiate a cache: publishing-cache
                          2013-04-26 14:36:03,722 Coherence Logger@9214443 3.7.1.6 ERROR 2013-04-26 14:36:03.722/177.433 Oracle Coherence GE 3.7.1.6 <Error> (thread=DistributedCache:DistributedCacheWithPublishingCacheStore, member=1):
                          java.lang.IllegalArgumentException: No scheme for cache: "publishing-cache"
                               at com.tangosol.net.DefaultConfigurableCacheFactory.findSchemeMapping(DefaultConfigurableCacheFactory.java:542)


                          Thanks for your time and help.