When a particular module is re-deployed, it can cause the Liferay clustering module: com.liferay.portal.cluster.multiple to restart.
This causes the CacheManager to shutdown and will not be restarted, even after the clustering module is restarted.
Steps to Reproduce
- Configure Liferay to enable clustering
- Start Liferay
- Deploy abc-poc.jar
- Wait till the module is fully deployed
- Restart Liferay
- Re-deploy abc-poc.jar
- Observe logs
The abc-poc module is stopped and is starts with the newly deployed version
The abc-poc module is stopped and the com.liferay.portal.cluster.multiple is also stopped.
Errors regarding "CacheManager has shut down" are shown.
This happens because abc.poc-1.0.0.jar exports the org.apache.logging.log4j package. If this module is started, then OSGi will find the package when JGroups asks for a class, which will cause com.liferay.portal.cluster.multiple to depend on abc.poc-1.0.0.jar, which will then cause com.liferay.portal.cluster.multiple to restart any time abc.poc-1.0.0.jar is redeployed.
A good starting point would be to understand why this directive was set and how it is being used:
This directive was added from
LPS-59378 to handle the imports dynamically for serialization/deserialization.
The main challenge is to find a solution that will prevent the scenario described on this ticket, as well as maintaining the serialization/deserialization functionalities introduced by