Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-22596

Event listeners are executed before the whole platform is started

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Won't Fix
    • Affects Version/s: 9.2-SNAPSHOT
    • Fix Version/s: 9.2
    • Component/s: Events / Works, Runtime

      Description

      Since NXP-19328, listeners are executed before the whole platform is started. For instance on a fresh 9.2-SNAPSHOT instance, with showcase content sample installed, we can see during startup the following stacktrace multiple times:

      2017-06-21 16:12:04,331 ERROR [localhost-startStop-1] [org.nuxeo.ecm.core.event.impl.EventServiceImpl] Exception during pictureChangedListener sync listener execution, continuing to run other listeners
      java.lang.IllegalArgumentException: null docRref
              at org.nuxeo.ecm.core.api.AbstractSession.resolveReference(AbstractSession.java:328)
              at org.nuxeo.ecm.core.api.AbstractSession.exists(AbstractSession.java:834)
              at org.nuxeo.ecm.platform.picture.listener.PictureChangedListener.getParentDocument(PictureChangedListener.java:134)
              at org.nuxeo.ecm.platform.picture.listener.PictureChangedListener.preFillPictureViews(PictureChangedListener.java:104)
              at org.nuxeo.ecm.platform.picture.listener.PictureChangedListener.handleEvent(PictureChangedListener.java:84)
              at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:242)
              at org.nuxeo.ecm.core.api.AbstractSession.notifyEvent(AbstractSession.java:270)
              at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:692)
              at org.nuxeo.ecm.showcase.content.ShowcaseWriter.createDocument(ShowcaseWriter.java:94)
              at org.nuxeo.ecm.core.io.impl.plugins.DocumentModelWriter.doWrite(DocumentModelWriter.java:88)
              at org.nuxeo.ecm.core.io.impl.plugins.DocumentModelWriter.write(DocumentModelWriter.java:75)
              at org.nuxeo.ecm.core.io.impl.AbstractDocumentWriter.write(AbstractDocumentWriter.java:53)
              at org.nuxeo.ecm.core.io.impl.DocumentPipeImpl.readAndWriteDocs(DocumentPipeImpl.java:127)
              at org.nuxeo.ecm.core.io.impl.DocumentPipeImpl.run(DocumentPipeImpl.java:102)
              at org.nuxeo.ecm.showcase.content.ShowcaseContentImporter.create(ShowcaseContentImporter.java:128)
              at org.nuxeo.ecm.showcase.content.ShowcaseContentImporter.create(ShowcaseContentImporter.java:86)
              at org.nuxeo.ecm.showcase.content.ShowcaseContentImporter.run(ShowcaseContentImporter.java:77)
              at org.nuxeo.ecm.showcase.content.service.ShowcaseContentServiceImpl.lambda$triggerImporters$0(ShowcaseContentServiceImpl.java:78)
              at java.util.ArrayList.forEach(ArrayList.java:1249)
              at org.nuxeo.ecm.showcase.content.service.ShowcaseContentServiceImpl.triggerImporters(ShowcaseContentServiceImpl.java:74)
              at org.nuxeo.ecm.showcase.content.InitListener.execute(InitListener.java:48)
              at org.nuxeo.ecm.platform.content.template.service.ContentTemplateServiceImpl.executePostContentCreationHandlers(ContentTemplateServiceImpl.java:194)
              at org.nuxeo.ecm.platform.content.template.listener.RepositoryInitializationListener.doInitializeRepository(RepositoryInitializationListener.java:44)
              at org.nuxeo.ecm.core.repository.RepositoryInitializationHandler.initializeRepository(RepositoryInitializationHandler.java:93)
              at org.nuxeo.ecm.core.repository.RepositoryInitializationHandler.initializeRepository(RepositoryInitializationHandler.java:91)
              at org.nuxeo.ecm.core.repository.RepositoryInitializationHandler.initializeRepository(RepositoryInitializationHandler.java:91)
              at org.nuxeo.ecm.core.repository.RepositoryService$2.run(RepositoryService.java:131)
              at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:131)
              at org.nuxeo.ecm.core.repository.RepositoryService.initializeRepository(RepositoryService.java:133)
              at org.nuxeo.ecm.core.repository.RepositoryService.doInitRepositories(RepositoryService.java:105)
              at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$3(TransactionHelper.java:569)
              at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589)
              at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:569)
              at org.nuxeo.ecm.core.repository.RepositoryService.initRepositories(RepositoryService.java:85)
              at org.nuxeo.ecm.core.repository.RepositoryService.start(RepositoryService.java:70)
              at org.nuxeo.runtime.model.impl.RegistrationInfoImpl.start(RegistrationInfoImpl.java:341)
              at org.nuxeo.runtime.model.impl.ComponentManagerImpl.startComponents(ComponentManagerImpl.java:565)
              at org.nuxeo.runtime.model.impl.ComponentManagerImpl.start(ComponentManagerImpl.java:623)
              at org.nuxeo.runtime.osgi.OSGiRuntimeService.startComponents(OSGiRuntimeService.java:460)
              at org.nuxeo.runtime.osgi.OSGiRuntimeService.frameworkEvent(OSGiRuntimeService.java:475)
              at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:232)
              at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:226)
              at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:125)
              at org.nuxeo.runtime.deployment.NuxeoStarter.start(NuxeoStarter.java:120)
              at org.nuxeo.runtime.deployment.NuxeoStarter.contextInitialized(NuxeoStarter.java:93)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
              at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)
              at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:748)
      

      Like the WorkManager, the event bus should be able to receive event, but it needs to wait the platform startup before executing the pending event.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kleturc Kevin Leturc
                Reporter:
                kleturc Kevin Leturc
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h