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

NPE at TrashImpl.getMaxAge when there are trashentry objects with a groupid that was deleted

    Details

      Description

      A NPE is thrown at TrashImpl.getMaxAge when there are trashentry with a groupid that was deleted.

      14:33:02,921 ERROR [liferay/scheduler_dispatch-6][ParallelDestination:72] Unable to process message {destinationName=liferay/scheduler_dispatch, response=null, responseDestinationName=null, responseId=null, payload=null, values={groupId=0, STORAGE_TYPE=MEMORY_CLUSTERED, JOB_NAME=com.liferay.portlet.trash.messaging.CheckEntryMessageListener, EXCEPTIONS_MAX_SIZE=0, GROUP_NAME=com.liferay.portlet.trash.messaging.CheckEntryMessageListener, DESTINATION_NAME=liferay/scheduler_dispatch, JOB_STATE=com.liferay.portal.kernel.scheduler.JobState@189308b4, companyId=0, MESSAGE_LISTENER_CLASS_NAME=com.liferay.portlet.trash.messaging.CheckEntryMessageListener, RECEIVER_KEY=com.liferay.portal.kernel.scheduler.messaging.ReceiverKey@84a48ec0, MESSAGE_LISTENER_UUID=60a23f47-50ff-4762-9937-c78b68cee5c5}}
      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.NullPointerException
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
      	at sun.reflect.GeneratedMethodAccessor328.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
      	at com.sun.proxy.$Proxy311.receive(Unknown Source)
      	at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:77)
      	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:744)
      Caused by: java.lang.NullPointerException
      	at com.liferay.portlet.trash.util.TrashImpl.getMaxAge(TrashImpl.java:220)
      	at com.liferay.portlet.trash.util.TrashUtil.getMaxAge(TrashUtil.java:80)
      	at com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl.getMaxAge(TrashEntryLocalServiceImpl.java:391)
      	at com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl$1.performAction(TrashEntryLocalServiceImpl.java:143)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActionsInSingleInterval(BaseActionableDynamicQuery.java:324)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:46)
      	at com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl.checkEntries(TrashEntryLocalServiceImpl.java:158)
      	at sun.reflect.GeneratedMethodAccessor1490.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
      	at com.sun.proxy.$Proxy191.checkEntries(Unknown Source)
      	at com.liferay.portlet.trash.service.TrashEntryLocalServiceUtil.checkEntries(TrashEntryLocalServiceUtil.java:307)
      	at com.liferay.portlet.trash.messaging.CheckEntryMessageListener.doReceive(CheckEntryMessageListener.java:28)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	... 11 more
      

      TrashEntryLocalServiceImpl.checkEntries() code checks every trashentry in order to purge the old entries, but if the entry has a deleted groupid, the process failes trying obtaining max-age value of the group because a NPE.

      The invalid data is produced by old bugs that leave inconsistent data during group deletion like LPS-47226 or LPS-51543.

      It is important to fix this issue because trash purge functionality stops working when this data causes the NPE.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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

                  Packages

                  Version Package
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 M5