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

Fix SearchEngineConfigurator initialization race condition and circular dependencies

    Details

      Description

      When starting up portal, the user will occasionally see the following errors:

           [exec] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchEngineConfigurator.core' defined in class path resource [META-INF/search-spring.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Name is null
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
           [exec] 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
           [exec] 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
           [exec] 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
           [exec] 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
           [exec] 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
           [exec] 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
           [exec] 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
           [exec] 	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
           [exec] 	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
           [exec] 	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
           [exec] 	at com.liferay.portal.spring.context.PortalContextLoaderListener.lambda$contextInitialized$0(PortalContextLoaderListener.java:283)
           [exec] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           [exec] 	at java.lang.Thread.run(Thread.java:745)
           [exec] Caused by: java.lang.IllegalArgumentException: Name is null
           [exec] 	at com.liferay.portal.kernel.messaging.BaseDestination.afterPropertiesSet(BaseDestination.java:39)
           [exec] 	at com.liferay.portal.messaging.internal.SynchronousDestinationPrototype.createDestination(SynchronousDestinationPrototype.java:36)
           [exec] 	at com.liferay.portal.messaging.internal.DefaultDestinationFactory.createDestination(DefaultDestinationFactory.java:57)
           [exec] 	at com.liferay.portal.kernel.messaging.DestinationFactoryUtil.createDestination(DestinationFactoryUtil.java:29)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.createSearchReaderDestination(AbstractSearchEngineConfigurator.java:140)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.getSearchReaderDestination(AbstractSearchEngineConfigurator.java:259)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.initSearchEngine(AbstractSearchEngineConfigurator.java:318)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.initialize(AbstractSearchEngineConfigurator.java:293)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator$1.dependenciesFulfilled(AbstractSearchEngineConfigurator.java:75)
           [exec] 	at com.liferay.registry.dependency.ServiceDependencyManager.verifyDependencies(ServiceDependencyManager.java:146)
           [exec] 	at com.liferay.registry.dependency.ServiceDependencyManager$ServiceDependencyServiceTrackerCustomizer.addingService(ServiceDependencyManager.java:242)
           [exec] 	at com.liferay.registry.internal.ServiceTrackerCustomizerAdapter.addingService(ServiceTrackerCustomizerAdapter.java:35)
           [exec] 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
           [exec] 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
           [exec] 	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
           [exec] 	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
           [exec] 	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
           [exec] 	at com.liferay.registry.internal.ServiceTrackerWrapper.open(ServiceTrackerWrapper.java:191)
           [exec] 	at com.liferay.registry.dependency.ServiceDependency.open(ServiceDependency.java:73)
           [exec] 	at com.liferay.registry.dependency.ServiceDependencyManager.registerDependencies(ServiceDependencyManager.java:72)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.afterPropertiesSet(AbstractSearchEngineConfigurator.java:84)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           [exec] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           [exec] 	at java.lang.reflect.Method.invoke(Method.java:498)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1700)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1639)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
           [exec] 	... 15 more
           [exec] 24-Jul-2018 15:02:45.436 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.liferay.portal.spring.context.PortalContextLoaderListener]
           [exec]  java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchEngineConfigurator.core' defined in class path resource [META-INF/search-spring.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Name is null
           [exec] 	at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:322)
           [exec] 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4579)
           [exec] 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5041)
           [exec] 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
           [exec] 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742)
           [exec] 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
           [exec] 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
           [exec] 	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
           [exec] 	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1840)
           [exec] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
           [exec] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           [exec] 	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
           [exec] 	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
           [exec] 	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:525)
           [exec] 	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:424)
           [exec] 	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586)
           [exec] 	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
           [exec] 	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
           [exec] 	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
           [exec] 	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
           [exec] 	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966)
           [exec] 	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
           [exec] 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
           [exec] 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
           [exec] 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
           [exec] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           [exec] 	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
           [exec] 	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
           [exec] 	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
           [exec] 	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
           [exec] 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
           [exec] 	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
           [exec] 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
           [exec] 	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
           [exec] 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
           [exec] 	at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           [exec] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           [exec] 	at java.lang.reflect.Method.invoke(Method.java:498)
           [exec] 	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
           [exec] 	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
           [exec] Caused by: java.util.concurrent.ExecutionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchEngineConfigurator.core' defined in class path resource [META-INF/search-spring.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Name is null
           [exec] 	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
           [exec] 	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
           [exec] 	at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:319)
           [exec] 	... 41 more
           [exec] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchEngineConfigurator.core' defined in class path resource [META-INF/search-spring.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Name is null
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
           [exec] 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
           [exec] 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
           [exec] 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
           [exec] 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
           [exec] 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
           [exec] 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
           [exec] 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
           [exec] 	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
           [exec] 	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
           [exec] 	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
           [exec] 	at com.liferay.portal.spring.context.PortalContextLoaderListener.lambda$contextInitialized$0(PortalContextLoaderListener.java:283)
           [exec] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           [exec] 	at java.lang.Thread.run(Thread.java:745)
           [exec] Caused by: java.lang.IllegalArgumentException: Name is null
           [exec] 	at com.liferay.portal.kernel.messaging.BaseDestination.afterPropertiesSet(BaseDestination.java:39)
           [exec] 	at com.liferay.portal.messaging.internal.SynchronousDestinationPrototype.createDestination(SynchronousDestinationPrototype.java:36)
           [exec] 	at com.liferay.portal.messaging.internal.DefaultDestinationFactory.createDestination(DefaultDestinationFactory.java:57)
           [exec] 	at com.liferay.portal.kernel.messaging.DestinationFactoryUtil.createDestination(DestinationFactoryUtil.java:29)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.createSearchReaderDestination(AbstractSearchEngineConfigurator.java:140)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.getSearchReaderDestination(AbstractSearchEngineConfigurator.java:259)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.initSearchEngine(AbstractSearchEngineConfigurator.java:318)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.initialize(AbstractSearchEngineConfigurator.java:293)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator$1.dependenciesFulfilled(AbstractSearchEngineConfigurator.java:75)
           [exec] 	at com.liferay.registry.dependency.ServiceDependencyManager.verifyDependencies(ServiceDependencyManager.java:146)
           [exec] 	at com.liferay.registry.dependency.ServiceDependencyManager$ServiceDependencyServiceTrackerCustomizer.addingService(ServiceDependencyManager.java:242)
           [exec] 	at com.liferay.registry.internal.ServiceTrackerCustomizerAdapter.addingService(ServiceTrackerCustomizerAdapter.java:35)
           [exec] 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
           [exec] 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
           [exec] 	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
           [exec] 	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
           [exec] 	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
           [exec] 	at com.liferay.registry.internal.ServiceTrackerWrapper.open(ServiceTrackerWrapper.java:191)
           [exec] 	at com.liferay.registry.dependency.ServiceDependency.open(ServiceDependency.java:73)
           [exec] 	at com.liferay.registry.dependency.ServiceDependencyManager.registerDependencies(ServiceDependencyManager.java:72)
           [exec] 	at com.liferay.portal.kernel.search.AbstractSearchEngineConfigurator.afterPropertiesSet(AbstractSearchEngineConfigurator.java:84)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           [exec] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           [exec] 	at java.lang.reflect.Method.invoke(Method.java:498)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1700)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1639)
           [exec] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
           [exec] 	... 15 more

      Reproduced on: master Git ID 3850bc121205793b3f6cbcbc5622b302c7d13900

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jason.pince Jason Pince
              Reporter:
              shuyang.zhou Shuyang Zhou
              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:
                3 years, 24 weeks, 2 days ago

                  Packages

                  Version Package
                  7.1.10 DXP FP1
                  7.1.1 CE GA2
                  7.1.10.1 SP1
                  7.1.X
                  Master