Uploaded image for project: 'ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)'
  1. ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)
  2. LEP-4781

4.3.5 and 4.3.6 portal fails deploy-undeploy-deploy sequence

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.3.6
    • Fix Version/s: 4.3.7, 4.4.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Liferay 4.3.5. bundled with JBoss and Tomcat

      Description

      The portal fails the deploy-undeploy-redeploy sequence for any simple portlet. To reproduce:
      1. Use any portlet (one that extends GenericPortlet) packaged in a war
      2. Deploy the portlet
      3. Add the portlet to a Liferay page
      4. Query the page with the browser - the portlet should work ok
      5. Undeploy the portlet
      6. Query the page with browser - the protlet should write - Portlet is temporarily unavailable
      7. re-deploy the porltet
      8. Query the page with browser - the portlet sould write - Portlet is temporarily unavailable

      Depending on the environment sometimes the whole page fails and a Java error page is rendered instead.

      The cause is that after undeploy of the portlet the com.liferay.portal.service.impl.PortletLocalServiceImpl class keeps a reference to the original class. This should be patched in the portlet undeploy process.

      My solution for the bug:
      1. com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeUndeploy(HotDeployEvent event) add a line:
      Iterator itr = portlets.iterator();

      while (itr.hasNext())

      { Portlet portlet = (Portlet)itr.next(); ... // Insert this line: PortletLocalServiceUtil.removePortlet(portlet); }

      2. Add the referenced method to the PortletLocalServiceUtil class where we delegate the cal to the implementation:
      public static void removePortlet(Portlet portlet)

      { PortletLocalService portletLocalService = PortletLocalServiceFactory.getService(); portletLocalService.removePortlet(portlet); }

      3. In the implementation class (com.liferay.portal.service.impl.PortletLocalServiceImpl):
      public void removePortlet(Portlet portlet)

      { Object removed=_getPortletsPool().remove(portlet.getPortletId()); clearCaches(); }

      Where clearCaches() is the two lines that are present in the initEAR and initWAR methods:
      private void clearCaches()

      { // Refresh security path to portlet id mapping for all portlets _portletIdsByStrutsPath.clear(); // Refresh company portlets _companyPortletsPool.clear(); }

      These patches have solved the undeploy-deploy problem for me

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            asch Schmidt András (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                4.3.7
                4.4.0