Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-39022

net.sf.ehcache.CacheException is thrown when replicateputsViaCopy=true

    Details

    • Branch Version/s:
      6.1.x, 6.0.x
    • Backported to Branch:
      Committed
    • Story Points:
      10

      Description

      Steps to reproduce:

      1. Set up two bundles.
      2. In both bundles:
      Add the following properties to the portal-ext.properties:

      cluster.link.enabled=true
      ehcache.cluster.link.replication.enabled=true
      

      Add "replicatePutsViaCopy=true" under "defaultCache" section in liferay-multi-vm-clustered.xml (turn others to true also).

      <defaultCache
      eternal="false"
      maxElementsInMemory="10000"
      overflowToDisk="false"
      timeToIdleSeconds="600"
      >
      <cacheEventListenerFactory
      class="com.liferay.portal.cache.ehcache.LiferayCacheEventListenerFactory"
      properties="replicatePutsViaCopy=true,replicatePuts=true,replicateUpdatesViaCopy=true"
      propertySeparator=","
      />
      <bootstrapCacheLoaderFactory class="com.liferay.portal.cache.ehcache.LiferayBootstrapCacheLoaderFactory" />
      </defaultCache>

      3. Deploy ehcache-cluster-web plugins in both bundles.
      4. Start up bundles in sequence.
      5. On one bundle site, go to control panel -> server administration -> script.
      Choose language as Groovy, put script as:

         com.liferay.portal.kernel.cache.PortalCache pc = com.liferay.portal.kernel.cache.MultiVMPoolUtil.getCache("testCacheId");
         pc.put("one", "ONE");
         pc.put("two", "TWO");
         pc.put("three", "THREE");
      

      then hit "Execute" button.

      Error Message:

      com.liferay.portal.kernel.messaging.MessageListenerException: net.sf.ehcache.CacheException: You have configured the cache with a replication scheme that cannot properly support CAS operation guarantees.
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
              at java.lang.Thread.run(Thread.java:724)
      

      Expected result:
      No error will be seen in the whole process.

      Actual result:
      The Error Message was thrown in console.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 46 weeks, 2 days ago