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

Scoped beans are only destroyed in the async RESOURCE_PHASE

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 7.1.0 CE GA1, 7.1.10 DXP GA1, 7.1.10 DXP FP1, 7.1.10 DXP FP2, 7.1.10 DXP FP3, 7.1.1 CE GA2, 7.1.10 DXP FP4, 7.1.10 DXP FP5, 7.1.10.1 SP1, 7.1.2 CE GA3, 7.1.10 DXP FP6, 7.1.10 DXP FP7, 7.1.10 DXP FP8
    • Fix Version/s: 7.1.X, Master
    • Labels:
      None

      Description

      Problem Background

      Currently, the only time scoped beans are destroyed is when the async RESOURCE_PHASE completes.

      However, scoped beans must be destroyed in the non-asnyc case as well or else methods annotated with @PreDestroy will not be called.

      Steps to Reproduce

      • Deploy the attached WAR to $LIFERAY_HOME/deploy and add the portlet named "LPS-91404" to a portal page.
      • Reload the page

      Expected Results

      In the console log, the following should appear:

      *** MyBean.postConstruct() called ***
      *** MyBean.preDestroy() called ***
      

      Specifically, it's the presence of the preDestroy one that verifies that this issue is fixed.

      Actual Results

      The preDestroy line does not appear in the log.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                25 weeks ago

                Packages

                Version Package
                7.1.X
                Master