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

Debug trace with exception is not written by LiferayPortlet in case child class redefines isSessionErrorException method



      The LiferayPortlet.processAction method has a try...catch that handles the PortletException thrown by the called action method.

      Inside the isSessionErrorException(cause) there is a debug trace that you can enable in order to get more information about the exception that is being handled in the catch block.

      The problem with isSessionErrorException(cause) is it is redefined by most of the children classes of LiferayPortlet, and they don't print the information about the exception (for example: com.liferay.layout.admin.web.internal.portlet.GroupPagesPortlet )

      To avoid this, I think we should move the _log.debug trace from the isSessionErrorException method to the processAction, so the exception will be always printed in the DEBUG mode even if the isSessionErrorException is redefined in a child class.

      You can reproduce this, forcing an error in the layout entries.

      Steps to reproduce

      1. Create a content page called "myTestPage"
      2. Stop your Liferay installation
      3. In order to generate a forced error, we are going to add some wrong data directly to the database:
        1. Set the page name to
          • <?xml version='1.0' encoding='UTF-8'?><root available-locales="en_US" default-locale="en_US"><Name language-id="en_US"></Name></root>
        2. You can set it using this SQL:
          • update Layout set name ='<?xml version=''1.0'' encoding=''UTF-8''?><root available-locales="en_US" default-locale="en_US"><Name language-id="en_US"></Name></root>' where name like '%myTestPage%'
      4. Start your Liferay installation
      5. Activate the DEBUG traces for the category com.liferay.portal.kernel.portlet.LiferayPortlet
      6. Go to the page list in the left menu
      7. Edit the content page created in the first step (now it will have an empty name)
      8. In the right bar, click on the "Look and Feel" button (the paint roller icon)
      9. Click on the "more" button.
      10. Save the changes
      11. Check the log file
        • Expected behavior: A DEBUG trace with the handled exception is written to the log file
        • Wrong behavior: There aren't any DEBUG traces in the log file with the handled exception




            summer.zhang Summer Zhang
            jorge.diaz Jorge Diaz
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Jorge Diaz
            0 Vote for this issue
            0 Start watching this issue


              Days since last comment:
              33 weeks, 6 days ago


                Version Package
                7.2.10 DXP FP15
                7.3.7 CE GA8
                7.3.10 DXP FP2
                7.4.1 CE GA2 DXP 7,4
                7.4.13 DXP GA1