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

Enabling Portlet Action Request Statistics from a portlet action causes NullPointerException

    Details

      Description

      I have a portlet that I use to enable Portlet request statistics but when I enable them for action requests i.e setting attribute MonitoringPortletActionRequest to true on MBean MonitoringPortletManager from action of the portlet it causes a DataSample with requestStatus = null to be pushed to liferay/monitoring message bus destination and this causes a NullPointerException on PortletStatistics class line 105.

      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.NullPointerException
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
      	at com.liferay.portal.monitoring.statistics.portlet.PortletStatistics.processDataSample(PortletStatistics.java:105)
      	at com.liferay.portal.monitoring.statistics.portlet.CompanyStatistics.processDataSample(CompanyStatistics.java:212)
      	at com.liferay.portal.monitoring.statistics.portlet.ServerStatistics.processDataSample(ServerStatistics.java:118)
      	at com.liferay.portal.monitoring.statistics.portlet.ServerStatistics.processDataSample(ServerStatistics.java:1)
      	at com.liferay.portal.kernel.monitoring.DefaultMonitoringProcessor.processDataSample(DefaultMonitoringProcessor.java:71)
      	at com.liferay.portal.monitoring.messaging.MonitoringMessageListener.doReceive(MonitoringMessageListener.java:42)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	... 5 more
      

      Here's the offending data sample

      {
      		displayName = Metrics, portletId = metrics_WAR_metricsportlet, requestType = ACTION, {
      			attributes = null, companyId = 10157, description = null, duration = 0, name = metrics, namespace = com.liferay.monitoring.Portlet, requestStatus = null, stopWatch = 0: 00: 00.003,
      			timeout = 0,
      			user = 10201
      		}
      

      This also causes the Internal Server Error to be displayed in the portal with no stacktrace just message NullPointerException.

        Attachments

          Activity

            People

            • Assignee:
              joyce.wang Joyce Wang
              Reporter:
              mika.koivisto Mika Koivisto
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 14 weeks, 2 days ago

                Packages

                Version Package
                7.0.0 DXP FP13
                7.0.0 DXP SP3
                7.0.3 CE GA4
                7.0.X EE
                Master