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

Hidden exceptions in LiferayPortlet class, "callActionMethod" and "callResourceMethod" methods

    Details

      Description

      Some exceptions are not included as root causes when a PortletException is thrown in these methods, as can be seen below using an excerpt of exception management in "com.liferay.portal.kernel.portlet.LiferayPortlet#callActionMethod":

      		catch (NoSuchMethodException nsme) {
      			try {
      				super.processAction(actionRequest, actionResponse);
      
      				return true;
      			}
      			catch (Exception e) {
      				throw new PortletException(nsme);
      			}
      		}
      

      When "PortletException" is created, "nsme" exception is passed as cause instead of "e", which is the real exception. This can lead to hard to diagnose bugs because resulting stacktrace will be really misguiding.

      A very basic portlet is attached to generate the exception easier.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 49 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 Alpha 2