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

NullPointerException thrown while calling SchedulerEngineHelperImpl.unregister

    Details

      Description

      Exception below is thrown while shutting down the portal:

      java.lang.NullPointerException
      	at com.liferay.portal.scheduler.internal.SchedulerEngineHelperImpl.lambda$unregister$0(SchedulerEngineHelperImpl.java:687)
      	at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
      	at com.liferay.portal.scheduler.internal.SchedulerEngineHelperImpl.unregister(SchedulerEngineHelperImpl.java:684)
      	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.DependencyManager.deactivateComponentManager(DependencyManager.java:2225)
      	at org.apache.felix.scr.impl.manager.DependencyManager.access$500(DependencyManager.java:55)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:1082)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:968)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1241)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1136)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:996)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1175)
      	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
      	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
      	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.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:222)
      	at com.liferay.registry.internal.ServiceRegistrationWrapper.unregister(ServiceRegistrationWrapper.java:77)
      	at com.liferay.portal.servlet.MainServlet.destroy(MainServlet.java:150)
      	at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1443)
      	at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1775)
      	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
      	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5465)
      	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
      	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424)
      	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      Suggested fix:

      https://github.com/liferay/liferay-portal/blob/master/modules/apps/foundation/portal-scheduler/portal-scheduler/src/main/java/com/liferay/portal/scheduler/internal/SchedulerEngineHelperImpl.java#L684

      Replace call to

       _serviceRegistrations.compute 

      with

       computeIfPresent 

        Attachments

          Activity

            People

            Assignee:
            harry.chai Harry Chai
            Reporter:
            igor.arouca Igor Arouca
            Participants of an Issue:
            Recent user:
            Harry Chai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

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

                Packages

                Version Package
                7.0.X
                Master