Retrieving custom cache entity fails with error


  • 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:

    DXP 7.1 throws:

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


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


  • 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${}=

    As an example:,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

    2./ point to override-liferay-multi-vm-clustered.xml in


    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

1 人中有 0 人觉得有帮助