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

NPE is thrown during shutdown when dl.file.rank.enabled is set to false

    Details

      Description

      Steps to Reproduce:

      1. Startup Liferay DXP 7.0 with the following portal property:
        • dl.file.rank.enabled=false
      2. Shutdown Liferay

      Expected Behavior
      No errors are shown

      Actual Behavior
      NPE is thrown

      Sample Error Message

      2019-06-14 00:28:37.249 ERROR [Refresh Thread: Equinox Container: 90058d23-3b8e-0019-165c-f6adc5440dc0][com_liferay_recent_documents_web:97] [com.liferay.recent.documents.web.internal.messaging.RecentDocumentsMessageListener(2552)] The deactivate method has thrown an exception
      java.lang.NullPointerException
      	at com.liferay.portal.scheduler.internal.SchedulerEngineHelperImpl.lambda$unregister$0(SchedulerEngineHelperImpl.java:689)
      	at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
      	at com.liferay.portal.scheduler.internal.SchedulerEngineHelperImpl.unregister(SchedulerEngineHelperImpl.java:686)
      	at com.liferay.recent.documents.web.internal.messaging.RecentDocumentsMessageListener.deactivate(RecentDocumentsMessageListener.java:91)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
      	at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
      	at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
      	at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
      	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
      	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.disposeImplementationObject(SingleComponentManager.java:343)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:152)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:813)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:787)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:579)
      	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:706)
      	at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:523)
      	at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:452)
      	at org.apache.felix.scr.impl.Activator.access$300(Activator.java:54)
      	at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:306)
      	at org.apache.felix.utils.extender.AbstractExtender$2.run(AbstractExtender.java:290)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at org.apache.felix.utils.extender.AbstractExtender.destroyExtension(AbstractExtender.java:312)
      	at org.apache.felix.utils.extender.AbstractExtender.bundleChanged(AbstractExtender.java:186)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
      	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
      	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
      	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
      	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
      	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
      	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
      	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
      	at org.eclipse.osgi.container.Module.doStop(Module.java:634)
      	at org.eclipse.osgi.container.Module.stop(Module.java:498)
      	at org.eclipse.osgi.container.ModuleContainer.unresolve0(ModuleContainer.java:867)
      	at org.eclipse.osgi.container.ModuleContainer.unresolve(ModuleContainer.java:781)
      	at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:978)
      	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1361)
      	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1263)
      	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
      	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

      Additional info (From origin ticket):

      After setting dl.file.rank.enabled=false, a NullPointerException is thrown by the deactivate() method.

      In reviewing the code: RecentDocumentsMessageListener.java#L57-L67 will not schedule the message listener when the dl.file.rank.enabled property is false.

      However, the deactivate method, RecentDocumentsMessageListener.java#L90-L92 always assumes the message listener has been scheduled.

      When the dl.file.rank.enabled property is false, the deactivate() method ends up generating an NPE

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                beck.liu Beck Liu
                Reporter:
                eric.yan Eric Yan
                Participants of an Issue:
                Recent user:
                Clarissa Velazquez
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  20 weeks, 6 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP84
                  7.0.X