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

CacheManager shuts down when re-deploying a module in a clustered environment



      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.

      A proof-of-concept module is attached to demonstrate this issue:
      Jar: abc.poc-1.0.0.jar
      Source: abc-poc.zip

      Steps to Reproduce 

      1. Configure Liferay to enable clustering
      2. Start Liferay
      3. Deploy abc-poc.jar
      4. Wait till the module is fully deployed
      5. Restart Liferay
      6. Re-deploy abc-poc.jar
      7. Observe logs

      Expected Result:
      The abc-poc module is stopped and is starts with the newly deployed version

      Actual Result:
      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.

      Additional Information
      A good starting point would be to understand why this directive was set and how it is being used:

      DynamicImport-Package: *

      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 LPS-59378.


        1. abc.poc-1.0.0.jar
          1.31 MB
        2. abc-poc.zip
          60 kB

          Issue Links



              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created:
                  Days since last comment:
                  2 years, 19 weeks, 3 days ago


                  Version Package