Legacy Knowledge Base
Published Sep. 10, 2025

Retrieving custom cache entity fails with error

Written By

Adam Zsolnay

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The custom cache entity we introduced to Liferay is inaccessible. We configured our custom cache in override-liferay-multi-vm-clustered.xml. When trying to access the custom cache entity from scripting console by:
    MultiVMPoolUtil.getPortalCache("com.custom.service.model.impl.AnyImpl").getKeys();

    DXP 7.1 throws:

    com.liferay.portal.cache.ehcache.LiferayCacheEventListenerFactory cannot be found by com.liferay.portal.cache.ehcache.impl_1.0.12

Environment

  • DXP 7.1 , DXP 7.0 (Fix pack 28+)

Resolution

  • Custom cache can be configured two ways: a) the plugin way or b) the xml way which is the case here. Please find the steps below.

    1./ tune the following portal property in portal-ext.properties:

    ehcache.replicator.properties.${specific.cache.name}=

    As an example:

    ehcache.replicator.properties.com.custom.service.model.impl.AnyImpl=replicatePutsViaCopy=true,replicateUpdatesViaCopy=true

    depending on how you want your custom cache to behave. If a value is not specified in the above property, it falls back to constants specifed in PortalCacheReplicator.java.

    2./ point to override-liferay-multi-vm-clustered.xml in portal-ext.properties:

    ehcache.multi.vm.config.location=/myehcache/override-liferay-multi-vm-clustered.xml

    via relative path, relative to WEB-INF/classes as an absolute path is not accepted. In the example above, the xml is placed in WEB-INF/classes/myehcache folder.

    3./  create the override-liferay-multi-vm-clustered.xml: extract liferay-multi-vm-clustered.xml from com.liferay.portal.cache.ehcache.impl.jar located in /osgi/marketplace/Liferay Foundation - Liferay Portal Cache - Impl.lpkg in DXP 7.1, or from com.liferay.portal.cache.ehcache.jar located in /osgi/marketplace/Liferay Foundation.lpkg in DXP 7.0, and rename the file to override-liferay-multi-vm-clustered.xml. Append your custom cache configuration at the end of the file before the </ehcache> tag.

    4./ place the override-liferay-multi-vm-clustered.xml on classpath (in WEB-INF/classes or its subfolder). In the example above, to WEB-INF/classes/myehcache folder) 

    5./ start the Portal.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base